-
- 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));
+ }
+ }