summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-11-23 15:46:47 +0100
committerKarolin Seeger <kseeger@samba.org>2020-12-09 07:57:19 +0000
commit39efb02c6b49fac0775b9011f82db9d71f6f101f (patch)
treee5fcdd886a389af585c7915c113f83d0e00d2c78 /lib
parent99ea8cd6dfa2ce30461e9bc9def18e9df6e8bf9f (diff)
downloadsamba-39efb02c6b49fac0775b9011f82db9d71f6f101f.tar.gz
debug: pass struct debug_class *config to reopen_one_log()
Pass a pointer to the struct instead of all struct members individually. No change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14248 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 29cd139a32d5dbf36bef68eb9c7f1160201e3042)
Diffstat (limited to 'lib')
-rw-r--r--lib/util/debug.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 08ffee35a1f..c17fa0c1db4 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1082,14 +1082,15 @@ static void debug_callback_log(const char *msg, int msg_level)
Fix from dgibson@linuxcare.com.
**************************************************************************/
-static bool reopen_one_log(int *fd, const char *logfile)
+static bool reopen_one_log(struct debug_class *config)
{
- int old_fd = *fd;
+ int old_fd = config->fd;
+ const char *logfile = config->logfile;
int new_fd;
if (logfile == NULL) {
debug_close_fd(old_fd);
- *fd = -1;
+ config->fd = -1;
return true;
}
@@ -1104,7 +1105,7 @@ static bool reopen_one_log(int *fd, const char *logfile)
debug_close_fd(old_fd);
smb_set_close_on_exec(new_fd);
- *fd = new_fd;
+ config->fd = new_fd;
return true;
}
@@ -1164,8 +1165,7 @@ bool reopen_logs_internal(void)
state.reopening_logs = true;
for (i = DBGC_ALL; i < debug_num_classes; i++) {
- ok = reopen_one_log(&dbgc_config[i].fd,
- dbgc_config[i].logfile);
+ ok = reopen_one_log(&dbgc_config[i]);
if (!ok) {
break;
}