[BACK]Return to sendbug.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sendbug

Diff for /src/usr.bin/sendbug/sendbug.c between version 1.77 and 1.78

version 1.77, 2016/10/18 20:07:35 version 1.78, 2017/08/21 21:41:13
Line 277 
Line 277 
                 execv(_PATH_BSHELL, argp);                  execv(_PATH_BSHELL, argp);
                 _exit(127);                  _exit(127);
         }          }
         while (waitpid(pid, &st, 0) == -1)          while (waitpid(pid, &st, 0) == -1) {
                 if (errno != EINTR)                  if (errno != EINTR)
                         goto fail;                          goto fail;
           }
         if (!WIFEXITED(st))          if (!WIFEXITED(st))
                 errno = EINTR;                  errno = EINTR;
         else          else
Line 317 
Line 318 
 sendmail(const char *pathname)  sendmail(const char *pathname)
 {  {
         int filedes[2];          int filedes[2];
           pid_t pid;
   
         if (pipe(filedes) == -1) {          if (pipe(filedes) == -1) {
                 warn("pipe: unsent report in %s", pathname);                  warn("pipe: unsent report in %s", pathname);
                 return (-1);                  return (-1);
         }          }
         switch (fork()) {          switch ((pid = fork())) {
         case -1:          case -1:
                 warn("fork error: unsent report in %s",                  warn("fork error: unsent report in %s",
                     pathname);                      pathname);
Line 349 
Line 351 
                         return (-1);                          return (-1);
                 }                  }
                 close(filedes[1]);                  close(filedes[1]);
                 wait(NULL);                  while (waitpid(pid, NULL, 0) == -1) {
                           if (errno != EINTR)
                                   break;
                   }
                 break;                  break;
         }          }
         return (0);          return (0);

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78