Moved the log rotation code out of the signal handler and into it's own

function.  The signal handler now simply sets a flag which is monitored
inside the thread_main_loop() function.  The log rotation code has also
been tightened to handle any error conditions better.  Credit to Petr
Lampa for suggesting that system functions inside of a signal handler is
bad magic.
This commit is contained in:
Robert James Kaes committed 2002-04-18 16:57:06 +00:00
1 parent 6a588826c1
commit 5822ec3d44
6 files changed
+95 -55

No files matched your search

+7 -1
View File
@@ -1,4 +1,4 @@
/* $Id: thread.c,v 1.24 2002-04-17 20:54:26 rjkaes Exp $
/* $Id: thread.c,v 1.25 2002-04-18 16:57:06 rjkaes Exp $
*
* Handles the creation/destruction of the various threads required for
* processing incoming connections.
@@ -321,6 +321,12 @@ thread_main_loop(void)
SERVER_UNLOCK();
sleep(5);
/* Handle log rotation if it was requested */
if (log_rotation_request) {
rotate_log_files();
log_rotation_request = FALSE;
}
}
}