Changes since 3.1.0b1
+- Allow trace output files (-tf option) to be overwritten, rather than
+ crashing dhcpd if the file already exists
+
- A bug was fixed that caused dhcpd to segfault if a pool was declared
outside the scope of a subnet in dhcpd.conf.
#ifndef lint
static char ocopyright[] =
-"$Id: trace.c,v 1.12 2006/02/24 23:16:30 dhankins Exp $ Copyright 2004-2006 Internet Systems Consortium.";
+"$Id: trace.c,v 1.13 2007/04/27 22:38:03 each Exp $ Copyright 2004-2006 Internet Systems Consortium.";
#endif
#include <omapip/omapip_p.h>
extern omapi_array_t *trace_listeners;
extern omapi_array_t *omapi_connections;
+extern int errno;
+
void trace_free_all ()
{
trace_type_t *tp;
}
traceoutfile = open (filename, O_CREAT | O_WRONLY | O_EXCL, 0600);
+ if (traceoutfile < 0 && errno == EEXIST) {
+ log_error ("WARNING: Overwriting trace file \"%s\"", filename);
+ traceoutfile = open (filename, O_WRONLY | O_EXCL, 0600);
+ }
+
if (traceoutfile < 0) {
log_error ("%s(%d): trace_begin: %s: %m",
file, line, filename);