X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=lib%2Futil%2Fdebug.c;fp=lib%2Futil%2Fdebug.c;h=fb4332f4273326f47138120b9fe447dffbcc6d4d;hp=c315222a9bb2a893ba4d289ccf5bb29da3d00690;hb=d792f15ff1406cde7f38ddc5febb08a8b39b90e8;hpb=249bdd9378306c146dca0eec6711e2c6b8eae29a diff --git a/lib/util/debug.c b/lib/util/debug.c index c315222a9bb..fb4332f4273 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -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; } /**************************************************************************