mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
[PATCH] wait() for specific pid to return from fork().
This commit is contained in:
parent
5a73b25fd6
commit
e920fed349
2
dev_d.c
2
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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user