DHCP Server Daemon. */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char ocopyright[] =
-"$Id: dhcpd.c,v 1.37 1997/02/18 14:30:11 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
+"$Id: dhcpd.c,v 1.38 1997/02/22 08:49:44 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
#endif
static char copyright[] =
}
}
- /* 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) {
- /* Become a daemon... */
+ /* First part of becoming a daemon... */
if ((pid = fork ()) < 0)
error ("Can't fork daemon: %m");
else if (pid)
exit (0);
- /* Become session leader and get pid... */
- close (0);
- close (1);
- close (2);
- pid = setsid ();
}
/* Read previous pid file. */
discover_interfaces (1);
#ifndef DEBUG
+ /* 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;
+
+ if (daemon) {
+ /* Become session leader and get pid... */
+ close (0);
+ close (1);
+ close (2);
+ pid = setsid ();
+ }
+
/* If we didn't write the pid file earlier because we found a
process running the logged pid, but we made it to here,
meaning nothing is listening on the bootp port, then write
#endif /* !DEBUG */
/* Receive packets and dispatch them... */
- dispatch ();
+ dispatch (1);
/* Not reached */
return 0;
DHCP Server Daemon. */
/*
- * Copyright (c) 1995, 1996 The Internet Software Consortium.
+ * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#ifndef lint
static char ocopyright[] =
-"$Id: dhcpd.c,v 1.37 1997/02/18 14:30:11 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
+"$Id: dhcpd.c,v 1.38 1997/02/22 08:49:44 mellon Exp $ Copyright 1995, 1996 The Internet Software Consortium.";
#endif
static char copyright[] =
}
}
- /* 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) {
- /* Become a daemon... */
+ /* First part of becoming a daemon... */
if ((pid = fork ()) < 0)
error ("Can't fork daemon: %m");
else if (pid)
exit (0);
- /* Become session leader and get pid... */
- close (0);
- close (1);
- close (2);
- pid = setsid ();
}
/* Read previous pid file. */
discover_interfaces (1);
#ifndef DEBUG
+ /* 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;
+
+ if (daemon) {
+ /* Become session leader and get pid... */
+ close (0);
+ close (1);
+ close (2);
+ pid = setsid ();
+ }
+
/* If we didn't write the pid file earlier because we found a
process running the logged pid, but we made it to here,
meaning nothing is listening on the bootp port, then write
#endif /* !DEBUG */
/* Receive packets and dispatch them... */
- dispatch ();
+ dispatch (1);
/* Not reached */
return 0;