summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-03-17 10:43:04 +0100
committerJim Meyering <jim@meyering.net>2007-03-17 10:43:04 +0100
commit11f43d2e22606620149fd66f09b9af601b8b19aa (patch)
treebc81a8692fe68d5e31d908b7ab69f726f6880778 /src/install.c
parent87c54fa0aeefe21c3cf9ae59ee9b3536a467106f (diff)
downloadcoreutils-11f43d2e22606620149fd66f09b9af601b8b19aa.tar.xz
Avoid an obscure build failure, prefer waitpid over wait.
* src/install.c (strip): Use waitpid, not wait. It's equivalent, but feels less obsolescent.
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/install.c b/src/install.c
index 8fc6a8a58..04577518c 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;
}
}