This finally enables per debug-class logfiles by hooking into
reopen_logs_internal() calls to reopen_one_log() per configured
debug-class.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
int old_fd = *fd;
int new_fd;
+ if (logfile == NULL) {
+ debug_close_fd(old_fd);
+ *fd = -1;
+ return true;
+ }
+
new_fd = open(logfile, O_WRONLY|O_APPEND|O_CREAT, 0644);
if (new_fd == -1) {
log_overflow = true;
state.reopening_logs = true;
- ok = reopen_one_log(&dbgc_config[DBGC_ALL].fd,
- dbgc_config[DBGC_ALL].logfile);
+ for (i = DBGC_ALL; i < debug_num_classes; i++) {
+ ok = reopen_one_log(&dbgc_config[i].fd,
+ dbgc_config[i].logfile);
+ if (!ok) {
+ break;
+ }
+ }
/* Fix from klausr@ITAP.Physik.Uni-Stuttgart.De
* to fix problem where smbd's that generate less