{
char buf[1024];
int pos = 0;
- int status;
+ int status = 0;
fd_set fds;
struct timeval timeout;
pos += len;
}
else if(waitpid(pid, &status, 0))
+ {
+ pid = 0;
break;
+ }
}
+ if(pid)
+ waitpid(pid, &status, 0);
+
buf[pos] = 0;
+ if(verbosity>=1)
+ {
+ if(WIFEXITED(status))
+ {
+ if(WEXITSTATUS(status))
+ printf("Command exited successfully\n");
+ else
+ printf("Command exited with status %d\n", WEXITSTATUS(status));
+ }
+ else if(WIFSIGNALED(status))
+ printf("Command terminated with signal %d\n", WTERMSIG(status));
+ else
+ printf("Command exited with unknown result %04X\n", status);
+ }
+
if(!WIFEXITED(status) || WEXITSTATUS(status))
{
GtkWidget *dialog;