From: kay.sievers@vrfy.org Date: Fri, 5 Nov 2004 12:16:56 +0000 (+0100) Subject: [PATCH] wait() for specific pid to return from fork(). X-Git-Tag: 043~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=inline;h=e920fed3499aa1445657b62499a11348faa3b24e;p=elogind.git [PATCH] wait() for specific pid to return from fork(). --- diff --git a/dev_d.c b/dev_d.c index be85f5277..64c254424 100644 --- a/dev_d.c +++ b/dev_d.c @@ -68,7 +68,7 @@ static int run_program(char *name) break; return -1; default: - wait(NULL); + waitpid(pid, NULL, 0); } return 0; diff --git a/namedev.c b/namedev.c index b142dda4f..f3fb3ff7e 100644 --- a/namedev.c +++ b/namedev.c @@ -444,7 +444,7 @@ static int execute_program(const char *path, char *value, int len) dbg("result is '%s'", value); close(fds[0]); - wait(&status); + waitpid(pid, &status, 0); if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) { dbg("exec program status 0x%x", status); diff --git a/udevsend.c b/udevsend.c index 84c46bc0c..b564d6453 100644 --- a/udevsend.c +++ b/udevsend.c @@ -82,7 +82,7 @@ static int start_daemon(void) dbg("fork of helper failed"); return -1; default: - wait(NULL); + waitpid(pid, NULL, 0); } return 0; } @@ -103,7 +103,7 @@ static void run_udev(const char *subsystem) dbg("fork of child failed"); break; default: - wait(NULL); + waitpid(pid, NULL, 0); } }