[BusyBox-cvs] busybox/networking/udhcp dhcpc.c,1.6,1.7

Russ Dill russ at busybox.net
Tue Jan 21 22:39:38 UTC 2003


Update of /var/cvs/busybox/networking/udhcp
In directory winder:/tmp/cvs-serv31057

Modified Files:
	dhcpc.c 
Log Message:
merge fixes with udhcp

Index: dhcpc.c
===================================================================
RCS file: /var/cvs/busybox/networking/udhcp/dhcpc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dhcpc.c	11 Dec 2002 22:43:37 -0000	1.6
+++ dhcpc.c	21 Jan 2003 22:39:34 -0000	1.7
@@ -51,7 +51,7 @@
 static unsigned long server_addr;
 static unsigned long timeout;
 static int packet_num; /* = 0 */
-static int fd;
+static int fd = -1;
 static int signal_pipe[2];
 
 #define LISTEN_NONE 0
@@ -109,7 +109,7 @@
 {
 	DEBUG(LOG_INFO, "entering %s listen mode",
 		new_mode ? (new_mode == 1 ? "kernel" : "raw") : "none");
-	close(fd);
+	if (fd >= 0) close(fd);
 	fd = -1;
 	listen_mode = new_mode;
 }
@@ -198,6 +198,7 @@
 		exit_client(1);
 	}
 	client_config.foreground = 1; /* Do not fork again. */
+	client_config.background_if_no_lease = 0;
 	pidfile_write_release(pid_fd);
 }
 
@@ -533,7 +534,7 @@
 			/* case BOUND, RELEASED: - ignore all packets */
 			}	
 		} else if (retval > 0 && FD_ISSET(signal_pipe[0], &rfds)) {
-			if (read(signal_pipe[0], &sig, sizeof(signal)) < 0) {
+			if (read(signal_pipe[0], &sig, sizeof(sig)) < 0) {
 				DEBUG(LOG_ERR, "Could not read signal: %s", 
 					strerror(errno));
 				continue; /* probably just EINTR */




More information about the busybox-cvs mailing list