mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
debug: update need_to_check_log_size() for per debug-class logfiles
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
249bdd9378
commit
d792f15ff1
@ -1187,17 +1187,30 @@ _PUBLIC_ void debug_schedule_reopen_logs(void)
|
||||
bool need_to_check_log_size(void)
|
||||
{
|
||||
int maxlog;
|
||||
size_t i;
|
||||
|
||||
if (debug_count < 100) {
|
||||
return false;
|
||||
}
|
||||
|
||||
maxlog = state.settings.max_log_size * 1024;
|
||||
if (state.fd <= 2 || maxlog <= 0) {
|
||||
if (maxlog <= 0) {
|
||||
debug_count = 0;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
if (state.fd > 2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (i = DBGC_ALL + 1; i < debug_num_classes; i++) {
|
||||
if (dbgc_config[i].fd != -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
debug_count = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user