1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

fixed bug with zombies after wmaker crashed

This commit is contained in:
dan
2004-10-14 20:24:00 +00:00
parent 8502709884
commit 2e572717c5

View File

@@ -90,7 +90,7 @@ int showCrashDialog(int sig)
int MonitorLoop(int argc, char **argv)
{
pid_t pid;
pid_t pid, exited;
char **child_argv= wmalloc(sizeof(char*)*(argc+2));
int i, status;
time_t last_start;
@@ -105,7 +105,7 @@ int MonitorLoop(int argc, char **argv)
last_start= time(NULL);
/* Start Window Maker */
pid= fork();
pid = fork();
if (pid == 0)
{
execvp(child_argv[0], child_argv);
@@ -118,12 +118,15 @@ int MonitorLoop(int argc, char **argv)
exit(1);
}
if (waitpid(pid, &status, 0) < 0)
if ((exited=waitpid(-1, &status, 0)) < 0)
{
wsyserror(_("Error during monitoring of Window Maker process."));
break;
}
if (exited != pid)
continue;
child_argv[argc]= "--for-real-";
/* Check if the wmaker process exited due to a crash */