aboutsummaryrefslogtreecommitdiff
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
parent6af21c2afac80e96cdea57508eabcfe2ea1aac01 (diff)
downloadbusybox-6393d69f76d363dacac58a492252b3e5f046e8d7.tar.gz
merge fixes with udhcp
-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 */
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 @@ static void change_mode(int new_mode)
{
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 @@ static void background(void)
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 @@ int main(int argc, char *argv[])
/* 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 */