Switch to libev.
[apps/pfixtools.git] / common / common.c
index e9e4f2e..dc0e194 100644 (file)
@@ -41,9 +41,6 @@
 
 #include "common.h"
 
-sig_atomic_t sigint  = false;
-sig_atomic_t sighup  = false;
-
 bool daemon_process  = true;
 int  log_level       = LOG_INFO;
 bool log_syslog      = false;
@@ -53,22 +50,13 @@ static FILE *pidfile = NULL;
 void common_sighandler(int sig)
 {
     switch (sig) {
-      case SIGTERM:
-      case SIGINT:
-        sigint = true;
-        return;
-
-      case SIGHUP:
-        sighup = true;
-        return;
-
       default:
         err("Killed (got signal %d)...", sig);
         exit(-1);
     }
 }
 
-static int setnonblock(int sock)
+int setnonblock(int sock)
 {
     int res = fcntl(sock, F_GETFL);
 
@@ -297,7 +285,7 @@ extern exitcall_t __madexit[];
 
 static void common_shutdown(void)
 {
-    if (daemon_process) {
+    if (daemon_process && log_syslog) {
         info("stopping...");
     }
     pidfile_close();