Browse code

do not call logg() in daemon_sighandler()

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1346 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2005/02/18 00:15:29
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Thu Feb 17 16:13:29 CET 2005 (tk)
2
+---------------------------------
3
+  * freshclam/freshclam.c: do not call logg() in daemon_sighandler()
4
+			   (patch by Trog)
5
+
1 6
 Wed Feb 16 22:23:40 GMT 2005 (njh)
2 7
 ----------------------------------
3 8
   * libclamav:		s/BLOB/BLOBCLASS/ for Win32
... ...
@@ -50,27 +50,22 @@ static short terminate = 0;
50 50
 
51 51
 
52 52
 static void daemon_sighandler(int sig) {
53
-	char *action = NULL;
54 53
 
55 54
     switch(sig) {
56 55
 	case SIGALRM:
57 56
 	case SIGUSR1:
58
-	    action = "wake up";
59 57
 	    terminate = -1;
60 58
 	    break;
61 59
 
62 60
 	case SIGHUP:
63
-	    action = "re-opening log file";
64 61
 	    terminate = -2;
65 62
 	    break;
66 63
 
67 64
 	default:
68
-	    action = "terminating";
69 65
 	    terminate = 1;
70 66
 	    break;
71 67
     }
72 68
 
73
-    logg("Received signal %d, %s\n", sig, action);
74 69
     return;
75 70
 }
76 71
 
... ...
@@ -327,8 +322,10 @@ int freshclam(struct optstruct *opt)
327 327
 	    } while (!terminate && now < wakeup);
328 328
 
329 329
 	    if (terminate == -1) {
330
+		logg("Received signal: wake up\n");
330 331
 		terminate = 0;
331 332
 	    } else if (terminate == -2) {
333
+		logg("Received signal: re-opening log file\n");
332 334
 		terminate = 0;
333 335
 		logg_close();
334 336
 	    }