chiark / gitweb /
[PATCH] wait() for specific pid to return from fork().
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Fri, 5 Nov 2004 12:16:56 +0000 (13:16 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 05:09:26 +0000 (22:09 -0700)
dev_d.c
namedev.c
udevsend.c

diff --git a/dev_d.c b/dev_d.c
index be85f52..64c2544 100644 (file)
--- 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;
index b142dda..f3fb3ff 100644 (file)
--- 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);
index 84c46bc..b564d64 100644 (file)
@@ -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);
        }
 }