1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +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) int MonitorLoop(int argc, char **argv)
{ {
pid_t pid; pid_t pid, exited;
char **child_argv= wmalloc(sizeof(char*)*(argc+2)); char **child_argv= wmalloc(sizeof(char*)*(argc+2));
int i, status; int i, status;
time_t last_start; time_t last_start;
@@ -118,12 +118,15 @@ int MonitorLoop(int argc, char **argv)
exit(1); exit(1);
} }
if (waitpid(pid, &status, 0) < 0) if ((exited=waitpid(-1, &status, 0)) < 0)
{ {
wsyserror(_("Error during monitoring of Window Maker process.")); wsyserror(_("Error during monitoring of Window Maker process."));
break; break;
} }
if (exited != pid)
continue;
child_argv[argc]= "--for-real-"; child_argv[argc]= "--for-real-";
/* Check if the wmaker process exited due to a crash */ /* Check if the wmaker process exited due to a crash */