Skip to content

Commit

Permalink
Merge pull request #430 from pi-hole/fix/no-daemon-mode
Browse files Browse the repository at this point in the history
Fix no-daemon mode forking dnsmasq and not logging
  • Loading branch information
DL6ER authored Dec 12, 2018
2 parents 88bad8c + 9b03470 commit 3634704
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions args.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion dnsmasq_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3634704

Please sign in to comment.