summaryrefslogtreecommitdiffhomepage
path: root/src/thread.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-18 16:57:06 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-18 16:57:06 +0000
commit5822ec3d44aa6ad2261d9e3ce07d589a7e6a3dcb (patch)
tree6367565772fd4a626c328e7f396113c213bd8eb3 /src/thread.c
parent6a588826c1411d3ea259a83f96f6744b20de65d6 (diff)
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.
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/thread.c b/src/thread.c
index 163f7d3..86c586f 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -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;
+ }
}
}