all repos — openbox @ 44358dfbaa66592da813ce84e88675dfa293384f

openbox fork - make it a bit more like ryudo

reap child processes when they die
Dana Jansens danakj@orodu.net
commit

44358dfbaa66592da813ce84e88675dfa293384f

parent

af1ac846ccb5fab8a3c83d8688db3d3f96f5a98b

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M src/openbox.ccsrc/openbox.cc

@@ -43,6 +43,10 @@ #ifdef HAVE_SYS_SELECT_H

# include <sys/select.h> #endif // HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_WAIT_H +# include <sys/wait.h> +#endif // HAVE_SYS_WAIT_H + #include "gettext.h" #define _(str) gettext(str) }

@@ -60,6 +64,10 @@ switch (signal) {

case SIGUSR1: printf("Caught SIGUSR1 signal. Restarting.\n"); openbox->restart(); + break; + + case SIGCLD: + wait(NULL); break; case SIGHUP:

@@ -113,6 +121,10 @@ sigaction(SIGFPE, &action, (struct sigaction *) 0);

sigaction(SIGTERM, &action, (struct sigaction *) 0); sigaction(SIGINT, &action, (struct sigaction *) 0); sigaction(SIGHUP, &action, (struct sigaction *) 0); + sigaction(SIGCLD, &action, (struct sigaction *) 0); + + // anything that died while we were restarting won't give us a SIGCLD + while (waitpid(-1, NULL, WNOHANG) > 0); otk::Timer::initialize(); otk::Property::initialize();