Fix no-daemon mode forking dnsmasq and not logging

no-daemon mode operates just like debug mode, but without the debug
output, and dnsmasq is not in debug mode.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-12-11 20:30:00 -05:00
parent 88bad8cb71
commit 9b03470dfd
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -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)
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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);