blob: 3b8c7eb0c05744c68a66a78033ae7f2029db26a7 [file] [log] [blame]
Glenn L McGrathbd5d84d2004-03-05 13:11:05 +00001Index: ./networking/udhcp/dhcpd.c
2===================================================================
3RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.c,v
4retrieving revision 1.5
5diff -u -r1.5 dhcpd.c
6--- a/./networking/udhcp/dhcpd.c 30 Jan 2004 23:45:12 -0000 1.5
7+++ b/./networking/udhcp/dhcpd.c 5 Mar 2004 13:09:05 -0000
8@@ -70,6 +70,13 @@
9 struct dhcpOfferedAddr *lease;
10 int max_sock;
11 unsigned long num_ips;
12+ int daemonize = 1;
Eric Andersenc7bda1c2004-03-15 08:29:22 +000013+
Glenn L McGrathbd5d84d2004-03-05 13:11:05 +000014+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
15+ daemonize = 0;
16+ argv++;
17+ argc--;
18+ }
Eric Andersenc7bda1c2004-03-15 08:29:22 +000019
Glenn L McGrathbd5d84d2004-03-05 13:11:05 +000020 memset(&server_config, 0, sizeof(struct server_config_t));
21 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
22@@ -99,9 +106,8 @@
23 &server_config.server, server_config.arp) < 0)
24 return 1;
Eric Andersenc7bda1c2004-03-15 08:29:22 +000025
Glenn L McGrathbd5d84d2004-03-05 13:11:05 +000026-#ifndef UDHCP_DEBUG
27- background(server_config.pidfile); /* hold lock during fork. */
28-#endif
29+ if(daemonize)
30+ background(server_config.pidfile); /* hold lock during fork. */
Eric Andersenc7bda1c2004-03-15 08:29:22 +000031
Glenn L McGrathbd5d84d2004-03-05 13:11:05 +000032 /* Setup the signal pipe */
33 udhcp_sp_setup();