Fix "warning: unused variable" if LOG_FILE is not defined
authorSATOH Fumiyasu <fumiyas@osstech.co.jp>
Tue, 3 Nov 2009 09:56:24 +0000 (10:56 +0100)
committerMarcela Mašláňová <mmaslano@redhat.com>
Tue, 3 Nov 2009 09:56:24 +0000 (10:56 +0100)
Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
src/misc.c

index c9f30545c84cddb9447a4ae22ce333a18aec40bb..8ccda51d2ff50e1b2e5976e902e7bdbb473f0ed3 100644 (file)
@@ -489,10 +489,12 @@ void log_it(const char *username, PID_T xpid, const char *event,
 #if defined(LOG_FILE) || DEBUGGING
        PID_T pid = xpid;
 #endif
+#if defined(LOG_FILE)
        char *msg;
        TIME_T now = time((TIME_T) 0);
        struct tm *t = localtime(&now);
        int msg_size;
+#endif
 
 #if defined(LOG_FILE)
        /* we assume that MAX_TEMPSTR will hold the date, time, &punctuation.