summaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorRuss Dill <Russ.Dill@asu.edu>2003-01-21 22:39:34 +0000
committerRuss Dill <Russ.Dill@asu.edu>2003-01-21 22:39:34 +0000
commit6393d69f76d363dacac58a492252b3e5f046e8d7 (patch)
tree37786f858993fd3be3f5a02ba7d63a5273d64895 /networking/udhcp/dhcpc.c
parent6af21c2afac80e96cdea57508eabcfe2ea1aac01 (diff)
downloadbusybox-w32-6393d69f76d363dacac58a492252b3e5f046e8d7.tar.gz
busybox-w32-6393d69f76d363dacac58a492252b3e5f046e8d7.tar.bz2
busybox-w32-6393d69f76d363dacac58a492252b3e5f046e8d7.zip
merge fixes with udhcp
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 55a672a6b..6abca6d1c 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -51,7 +51,7 @@ static unsigned long requested_ip; /* = 0 */
51static unsigned long server_addr; 51static unsigned long server_addr;
52static unsigned long timeout; 52static unsigned long timeout;
53static int packet_num; /* = 0 */ 53static int packet_num; /* = 0 */
54static int fd; 54static int fd = -1;
55static int signal_pipe[2]; 55static int signal_pipe[2];
56 56
57#define LISTEN_NONE 0 57#define LISTEN_NONE 0
@@ -109,7 +109,7 @@ static void change_mode(int new_mode)
109{ 109{
110 DEBUG(LOG_INFO, "entering %s listen mode", 110 DEBUG(LOG_INFO, "entering %s listen mode",
111 new_mode ? (new_mode == 1 ? "kernel" : "raw") : "none"); 111 new_mode ? (new_mode == 1 ? "kernel" : "raw") : "none");
112 close(fd); 112 if (fd >= 0) close(fd);
113 fd = -1; 113 fd = -1;
114 listen_mode = new_mode; 114 listen_mode = new_mode;
115} 115}
@@ -198,6 +198,7 @@ static void background(void)
198 exit_client(1); 198 exit_client(1);
199 } 199 }
200 client_config.foreground = 1; /* Do not fork again. */ 200 client_config.foreground = 1; /* Do not fork again. */
201 client_config.background_if_no_lease = 0;
201 pidfile_write_release(pid_fd); 202 pidfile_write_release(pid_fd);
202} 203}
203 204
@@ -533,7 +534,7 @@ int main(int argc, char *argv[])
533 /* case BOUND, RELEASED: - ignore all packets */ 534 /* case BOUND, RELEASED: - ignore all packets */
534 } 535 }
535 } else if (retval > 0 && FD_ISSET(signal_pipe[0], &rfds)) { 536 } else if (retval > 0 && FD_ISSET(signal_pipe[0], &rfds)) {
536 if (read(signal_pipe[0], &sig, sizeof(signal)) < 0) { 537 if (read(signal_pipe[0], &sig, sizeof(sig)) < 0) {
537 DEBUG(LOG_ERR, "Could not read signal: %s", 538 DEBUG(LOG_ERR, "Could not read signal: %s",
538 strerror(errno)); 539 strerror(errno));
539 continue; /* probably just EINTR */ 540 continue; /* probably just EINTR */