fixes to control flow view GC
[lttv.git] / ltt / branches / poly / lttv / modules / gui / tracecontrol / tracecontrol.c
index da4df4fb8b1951644f3977a0b78d0ca23b312d62..1193046d1feafbb17a58f72b741a0c42d8db3eef 100644 (file)
@@ -45,6 +45,7 @@
 #include <utmp.h>
 #include <sys/wait.h>
 #include <sys/poll.h>
+#include <errno.h>
 
 #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.");
 
This page took 0.022779 seconds and 4 git commands to generate.