diff --git a/args.c b/args.c index b0054408..13b464a4 100644 --- a/args.c +++ b/args.c @@ -35,6 +35,7 @@ void parse_args(int argc, char* argv[]) strcmp(argv[i], "debug") == 0) { debug = true; + daemonmode = false; ok = true; // Replace "-k" by "-d" (debug mode implies nofork) diff --git a/dnsmasq_interface.c b/dnsmasq_interface.c index e5f53938..b806a1b8 100644 --- a/dnsmasq_interface.c +++ b/dnsmasq_interface.c @@ -863,7 +863,7 @@ pthread_t DNSclientthread; void FTL_fork_and_bind_sockets(struct passwd *ent_pw) { - if(!debug && daemonmode) + if(daemonmode) go_daemon(); else savepid(); diff --git a/log.c b/log.c index 41c0b810..83e73e11 100644 --- a/log.c +++ b/log.c @@ -71,7 +71,7 @@ void logg(const char *format, ...) get_timestr(timestring); // Print to stdout before writing to file - if(debug) + if(!daemonmode) { printf("[%s] ", timestring); va_start(args, format);