=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sendbug/sendbug.c,v retrieving revision 1.77 retrieving revision 1.78 diff -c -r1.77 -r1.78 *** src/usr.bin/sendbug/sendbug.c 2016/10/18 20:07:35 1.77 --- src/usr.bin/sendbug/sendbug.c 2017/08/21 21:41:13 1.78 *************** *** 1,4 **** ! /* $OpenBSD: sendbug.c,v 1.77 2016/10/18 20:07:35 kettenis Exp $ */ /* * Written by Ray Lai . --- 1,4 ---- ! /* $OpenBSD: sendbug.c,v 1.78 2017/08/21 21:41:13 deraadt Exp $ */ /* * Written by Ray Lai . *************** *** 277,285 **** execv(_PATH_BSHELL, argp); _exit(127); } ! while (waitpid(pid, &st, 0) == -1) if (errno != EINTR) goto fail; if (!WIFEXITED(st)) errno = EINTR; else --- 277,286 ---- execv(_PATH_BSHELL, argp); _exit(127); } ! while (waitpid(pid, &st, 0) == -1) { if (errno != EINTR) goto fail; + } if (!WIFEXITED(st)) errno = EINTR; else *************** *** 317,328 **** sendmail(const char *pathname) { int filedes[2]; if (pipe(filedes) == -1) { warn("pipe: unsent report in %s", pathname); return (-1); } ! switch (fork()) { case -1: warn("fork error: unsent report in %s", pathname); --- 318,330 ---- sendmail(const char *pathname) { int filedes[2]; + pid_t pid; if (pipe(filedes) == -1) { warn("pipe: unsent report in %s", pathname); return (-1); } ! switch ((pid = fork())) { case -1: warn("fork error: unsent report in %s", pathname); *************** *** 349,355 **** return (-1); } close(filedes[1]); ! wait(NULL); break; } return (0); --- 351,360 ---- return (-1); } close(filedes[1]); ! while (waitpid(pid, NULL, 0) == -1) { ! if (errno != EINTR) ! break; ! } break; } return (0);