2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +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:
Andrey Vagin
2013-04-10 01:24:08 +04:00
committed by Pavel Emelyanov
parent 4dac517b00
commit edc865361e

View File

@@ -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);