#include <string.h>
#include <sys/socket.h>
#include <pwd.h>
+#include <sys/signal.h>
#include <errno.h>
#ifdef HAVE_CONFIG_H
exit(1);
}
}
+ signal(SIGPIPE, SIG_IGN);
if(daemonize) {
daemon(0, 0);
}
- if(pidout != NULL)
+ if(pidout != NULL) {
fprintf(pidout, "%i\n", getpid());
- fclose(pidout);
+ fclose(pidout);
+ }
ioloop();
return(0);
}