]> Zhao Yanbai Git Server - minix.git/commitdiff
Save errors to dhcpd log.
authorBen Gras <ben@minix3.org>
Mon, 19 Sep 2005 14:46:01 +0000 (14:46 +0000)
committerBen Gras <ben@minix3.org>
Mon, 19 Sep 2005 14:46:01 +0000 (14:46 +0000)
commands/dhcpd/dhcpd.c

index b83d696c308455ef3d7796dcb6daac024e1fe0a8..129d9e716ea256ad4afa5d997ddd99a8bd055979 100755 (executable)
@@ -47,7 +47,11 @@ static unsigned n_nets;              /* Actual number of networks. */
 
 void report(const char *label)
 {
-    fprintf(stderr, "%s: %s: %s\n", program, label, strerror(errno));
+    static FILE *logfp;
+    if(!logfp)
+       logfp = fopen("/usr/log/dhcp.log", "w");
+    if(logfp)
+       fprintf(logfp, "%s: %s: %s\n", program, label, strerror(errno));
 }
 
 void fatal(const char *label)