From e7b12578588e1fb584b8a5164d54745b49213f0a Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 19 Sep 2005 14:46:01 +0000 Subject: [PATCH] Save errors to dhcpd log. --- commands/dhcpd/dhcpd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/dhcpd/dhcpd.c b/commands/dhcpd/dhcpd.c index b83d696c3..129d9e716 100755 --- a/commands/dhcpd/dhcpd.c +++ b/commands/dhcpd/dhcpd.c @@ -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)