summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-09-15 14:48:59 +0200
committerLennart Poettering <lennart@poettering.net>2010-09-15 14:48:59 +0200
commit8e12a6aed3d99ac8c140cd56b560f5efeb1c4e1a (patch)
tree39f251b6aae53cbd767186f8efe3715270c220aa /src/util.c
parent2e78aa9988425d540a572535fa2e3d68ff519316 (diff)
util: use waitid() instead of waitpid() everywhere to avoid confusion due to SIGSTOP
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 805d47afb4..a3d6b49710 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3101,12 +3101,14 @@ char *unquote(const char *s, const char quote) {
return strdup(s);
}
-int waitpid_loop(pid_t pid, int *status) {
+int wait_for_terminate(pid_t pid, siginfo_t *status) {
assert(pid >= 1);
assert(status);
for (;;) {
- if (waitpid(pid, status, 0) < 0) {
+ zero(*status);
+
+ if (waitid(P_PID, pid, status, WEXITED) < 0) {
if (errno == EINTR)
continue;