From 142837e5d3bd9d3d853fc1c2eb181fea87a38d3a Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 30 Jan 2003 04:38:39 +0000 Subject: Merge of controversial 'max log size' fix. (This used to be commit 71e2b60d8f784174cd2a75c5e03bf2a6ab353900) --- source3/smbd/process.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/smbd/process.c') diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 8018d5f6f6..98ec6ce184 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1314,5 +1314,17 @@ void smbd_process(void) last_timeout_processing_time = new_check_time; /* Reset time. */ } } + + /* The timeout_processing function isn't run nearly + often enough to implement 'max log size' without + overrunning the size of the file by many megabytes. + This is especially true if we are running at debug + level 10. Checking every 50 SMBs is a nice + tradeoff of performance vs log file size overrun. */ + + if ((num_smbs % 50) == 0 && need_to_check_log_size()) { + change_to_root_user(); + check_log_size(); + } } } -- cgit