X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.cc;h=9642cd062f4354efcbf6a5642c32e235157876ca;hb=5b52a8f5610d3cc0a39ecb6b341e69596d892099;hp=d599e7bfc19ba4128b79eb472dd99d72630896ef;hpb=3a83fe7e6cd2fa65a6f54a91bb28fa96cff24332;p=chaz%2Fopenbox diff --git a/src/openbox.cc b/src/openbox.cc index d599e7bf..9642cd06 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -43,6 +43,10 @@ extern "C" { # include #endif // HAVE_SYS_SELECT_H +#ifdef HAVE_SYS_WAIT_H +# include +#endif // HAVE_SYS_WAIT_H + #include "gettext.h" #define _(str) gettext(str) } @@ -62,6 +66,10 @@ void Openbox::signalHandler(int signal) openbox->restart(); break; + case SIGCHLD: + wait(NULL); + break; + case SIGHUP: case SIGINT: case SIGTERM: @@ -113,6 +121,10 @@ Openbox::Openbox(int argc, char **argv) sigaction(SIGTERM, &action, (struct sigaction *) 0); sigaction(SIGINT, &action, (struct sigaction *) 0); sigaction(SIGHUP, &action, (struct sigaction *) 0); + sigaction(SIGCHLD, &action, (struct sigaction *) 0); + + // anything that died while we were restarting won't give us a SIGCHLD + while (waitpid(-1, NULL, WNOHANG) > 0); otk::Timer::initialize(); otk::Property::initialize();