+We now work with SIGCHLD and call wait so that we don't leave any
+zombies lying around.
For infinite timeout, we now resent the last request at +TIMEOUT_MINI
intervals until TIMEOUT_MINI_INF is reached, thanks to siadak.
We now return a non zero exit code on SIGTERM and SIGINT if we have not
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <sys/types.h>
#include <sys/select.h>
+#include <sys/wait.h>
#include <arpa/inet.h>
#ifdef __linux__
#include <netinet/ether.h>
{
switch (sig)
{
+ case SIGCHLD:
+ /* Silently ignore this signal and wait for it
+ This stops zombies */
+ wait (0);
+ break;
case SIGINT:
- logger (LOG_INFO, "receieved SIGINT, stopping");
+ logger (LOG_INFO, "received SIGINT, stopping");
retval = (! daemonised);
goto eexit;
case SIGTERM:
- logger (LOG_INFO, "receieved SIGTERM, stopping");
+ logger (LOG_INFO, "received SIGTERM, stopping");
retval = (! daemonised);
goto eexit;
case SIGALRM:
- logger (LOG_INFO, "receieved SIGALRM, renewing lease");
+ logger (LOG_INFO, "received SIGALRM, renewing lease");
switch (state)
{
case STATE_BOUND:
}
else
logger (LOG_ERR,
- "receieved SIGHUP, but no we have lease to release");
+ "received SIGHUP, but no we have lease to release");
retval = 0;
goto eexit;
signal (SIGALRM, signal_handler);
signal (SIGTERM, signal_handler);
signal (SIGINT, signal_handler);
+ signal (SIGCHLD, signal_handler);
}
/* Quick little function to setup the rfds. Will return the