X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Ftracecontrol%2Ftracecontrol.c;h=1193046d1feafbb17a58f72b741a0c42d8db3eef;hb=6cec4cd266bde25f87dad0a059fd98c7381eb8c2;hp=da4df4fb8b1951644f3977a0b78d0ca23b312d62;hpb=29e34d6c3b4a9fa6fb181647d224efaac2461ffb;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c b/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c index da4df4fb..1193046d 100644 --- a/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c +++ b/ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c @@ -45,6 +45,7 @@ #include #include #include +#include #define MAX_ARGS_LEN PATH_MAX * 10 @@ -536,13 +537,18 @@ wait_child: g_info("Waiting for child exit..."); ret = waitpid(pid, &status, 0); - - if(WIFEXITED(status)) - if(WEXITSTATUS(status) != 0) { - retval = WEXITSTATUS(status); - g_warning("An error occured in the su command : %s", - strerror(retval)); - } + + if(ret == -1) { + g_warning("An error occured in wait : %s", + strerror(errno)); + } else { + if(WIFEXITED(status)) + if(WEXITSTATUS(status) != 0) { + retval = WEXITSTATUS(status); + g_warning("An error occured in the su command : %s", + strerror(retval)); + } + } g_info("Child exited.");