Use the state to avoid recursion in reopen_logs(), as DEBUG() can call
this function.
Andrew Bartlett
int fd;
enum debug_logtype logtype;
const char *prog_name;
+ bool reopening_logs;
} state;
static bool reopen_logs_scheduled;
{
char *fname = NULL;
int old_fd = state.fd;
+ if (state.reopening_logs) {
+ return;
+ }
switch (state.logtype) {
case DEBUG_STDOUT:
break;
case DEBUG_FILE:
+ state.reopening_logs = true;
if (logfile && (*logfile) == '/') {
fname = strdup(logfile);
} else {
} else {
DEBUG(1, ("Failed to find name for file-based logfile!\n"));
}
+ state.reopening_false = true;
break;
}