summaryrefslogtreecommitdiff
path: root/lib/util/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/debug.c')
-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 d990a6bf2b0..864adbeeec4 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -30,6 +30,7 @@
#include "util_strlist.h" /* LIST_SEP */
#include "blocking.h"
#include "debug.h"
+#include <assert.h>
/* define what facility to use for syslog */
#ifndef SYSLOG_FACILITY
@@ -1113,6 +1114,7 @@ static bool reopen_one_log(int *fd, const char *logfile)
*/
bool reopen_logs_internal(void)
{
+ struct debug_backend *b = NULL;
mode_t oldumask;
int new_fd = 0;
size_t i;
@@ -1140,15 +1142,13 @@ bool reopen_logs_internal(void)
dbgc_config[DBGC_ALL].fd = 2;
return true;
- case DEBUG_FILE: {
- struct debug_backend *b = debug_find_backend("file");
+ case DEBUG_FILE:
+ b = debug_find_backend("file");
+ assert(b != NULL);
- if (b != NULL) {
- b->log_level = dbgc_config[DBGC_ALL].loglevel;
- }
+ b->log_level = dbgc_config[DBGC_ALL].loglevel;
break;
}
- }
oldumask = umask( 022 );