From: Jim Meyering Date: Sat, 17 Mar 2007 09:43:04 +0000 (+0100) Subject: Avoid an obscure build failure, prefer waitpid over wait. X-Git-Tag: COREUTILS-6_9~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11f43d2e22606620149fd66f09b9af601b8b19aa;p=thirdparty%2Fcoreutils.git Avoid an obscure build failure, prefer waitpid over wait. * src/install.c (strip): Use waitpid, not wait. It's equivalent, but feels less obsolescent. --- diff --git a/ChangeLog b/ChangeLog index a8d6ba3e78..5bb7f96095 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-03-17 Jim Meyering + Avoid an obscure build failure, prefer waitpid over wait. + * src/install.c (strip): Use waitpid, not wait. It's equivalent, + but feels less obsolescent. + * bootstrap: Don't use \> in grep regexp. For HP-UX. 2007-03-16 Jim Meyering diff --git a/src/install.c b/src/install.c index 8fc6a8a581..04577518ce 100644 --- a/src/install.c +++ b/src/install.c @@ -566,11 +566,10 @@ strip (char const *name) error (EXIT_FAILURE, errno, _("cannot run strip")); break; default: /* Parent. */ - /* Parent process. */ - while (pid != wait (&status)) /* Wait for kid to finish. */ - /* Do nothing. */ ; - if (status) - error (EXIT_FAILURE, 0, _("strip failed")); + if (waitpid (pid, &status, 0) < 0) + error (EXIT_FAILURE, errno, _("waiting for strip")); + else if (! WIFEXITED (status) || WEXITSTATUS (status)) + error (EXIT_FAILURE, 0, _("strip process terminated abnormally")); break; } }