Commit edc86536 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: print an error message and exit if exec failed

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 4dac517b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment