From f5d07a3896e194acc01da7932f3d2834c11d06b5 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Thu, 29 Aug 1996 20:15:32 +0000 Subject: [PATCH] Fix logging to stderr --- dhcpd.c | 11 ++++++++--- server/dhcpd.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dhcpd.c b/dhcpd.c index 12054dc9..1b0c100c 100644 --- a/dhcpd.c +++ b/dhcpd.c @@ -41,7 +41,7 @@ */ static char objcopyright[] = -"$Id: dhcpd.c,v 1.29 1996/08/29 09:55:52 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.30 1996/08/29 20:15:32 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; static char copyright[] = "Copyright 1995, 1996 The Internet Software Consortium."; static char arr [] = "All rights reserved."; @@ -118,7 +118,7 @@ int main (argc, argv, envp) } else if (!strcmp (argv [i], "-d")) { #ifndef DEBUG daemon = 0; - log_perror = 1; + log_perror = -1; #endif } else if (argv [i][0] == '-') { usage (); @@ -137,7 +137,12 @@ int main (argc, argv, envp) } } - log_perror = 0; + /* If we were requested to log to stdout on the command line, + keep doing so; otherwise, stop. */ + if (log_perror == -1) + log_perror = 1; + else + log_perror = 0; #ifndef DEBUG if (daemon) { diff --git a/server/dhcpd.c b/server/dhcpd.c index 12054dc9..1b0c100c 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -41,7 +41,7 @@ */ static char objcopyright[] = -"$Id: dhcpd.c,v 1.29 1996/08/29 09:55:52 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.30 1996/08/29 20:15:32 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium."; static char copyright[] = "Copyright 1995, 1996 The Internet Software Consortium."; static char arr [] = "All rights reserved."; @@ -118,7 +118,7 @@ int main (argc, argv, envp) } else if (!strcmp (argv [i], "-d")) { #ifndef DEBUG daemon = 0; - log_perror = 1; + log_perror = -1; #endif } else if (argv [i][0] == '-') { usage (); @@ -137,7 +137,12 @@ int main (argc, argv, envp) } } - log_perror = 0; + /* If we were requested to log to stdout on the command line, + keep doing so; otherwise, stop. */ + if (log_perror == -1) + log_perror = 1; + else + log_perror = 0; #ifndef DEBUG if (daemon) {