[CRIU] [PATCH] zdtm: print an error message and exit if exec failed
Andrey Vagin
avagin at openvz.org
Fri Apr 5 07:52:19 EDT 2013
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
test/zdtm/lib/ns.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c
index ead4522..dd3c6fd 100644
--- a/test/zdtm/lib/ns.c
+++ b/test/zdtm/lib/ns.c
@@ -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);
--
1.7.11.7
More information about the CRIU
mailing list