summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index ce40562..22e69ba 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -295,13 +295,14 @@ main(int argc, char *argv[])
int ch, fd, quiet = 0, i = 0;
int pipe_fd[2];
int immediate_daemon = 0;
+ int persist = 0;
struct passwd *pw;
/* Initially, log errors to stderr as well as to syslogd. */
openlog(__progname, LOG_PID | LOG_NDELAY, DHCPD_LOG_FACILITY);
setlogmask(LOG_UPTO(LOG_INFO));
- while ((ch = getopt(argc, argv, "bc:dl:qu")) != -1)
+ while ((ch = getopt(argc, argv, "bc:dl:pqu")) != -1)
switch (ch) {
case 'b':
immediate_daemon = 1;
@@ -315,6 +316,9 @@ main(int argc, char *argv[])
case 'l':
path_dhclient_db = optarg;
break;
+ case 'p':
+ persist = 1;
+ break;
case 'q':
quiet = 1;
break;
@@ -362,12 +366,18 @@ main(int argc, char *argv[])
fprintf(stderr, ".");
fflush(stderr);
if (++i > 10) {
- fprintf(stderr, " giving up\n");
- exit(1);
+ if (persist) {
+ fprintf(stderr, " giving up for now\n");
+ break;
+ } else {
+ fprintf(stderr, " giving up\n");
+ exit(1);
+ }
}
sleep(1);
}
- fprintf(stderr, " got link\n");
+ if (i <= 10)
+ fprintf(stderr, " got link\n");
}
if ((nullfd = open(_PATH_DEVNULL, O_RDWR, 0)) == -1)
OpenPOWER on IntegriCloud