mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
zdtm: print an error message and exit if exec failed
Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
4dac517b00
commit
edc865361e
@@ -214,6 +214,8 @@ int ns_init(int argc, char **argv)
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
|
||||
fprintf(stderr, "Unable to execute ps: %m\n");
|
||||
exit(1);
|
||||
} else if (pid > 0)
|
||||
waitpid(pid, NULL, 0);
|
||||
|
||||
@@ -229,6 +231,8 @@ int ns_init(int argc, char **argv)
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
|
||||
fprintf(stderr, "Unable to execute ps: %m\n");
|
||||
exit(1);
|
||||
} else if (pid > 0)
|
||||
waitpid(pid, NULL, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user