]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move the immediate background flag to 'b'
authorRoy Marples <roy@marples.name>
Fri, 18 Jul 2008 09:11:35 +0000 (09:11 +0000)
committerRoy Marples <roy@marples.name>
Fri, 18 Jul 2008 09:11:35 +0000 (09:11 +0000)
client.c
dhcpcd.8.in
dhcpcd.c
dhcpcd.h

index 8e62cf1550fbadd405be57482ef46448d4630f2d..151b0cd9c67ccaf7eb09634a8840718ce557882a 100644 (file)
--- a/client.c
+++ b/client.c
@@ -600,7 +600,7 @@ client_setup(struct if_state *state, const struct options *options)
        if (state->options & DHCPCD_LINK) {
                open_link_socket(iface);
                if (carrier_status(iface->name) == 0) {
-                       if (!(state->options & DHCPCD_NOWAIT))
+                       if (!(state->options & DHCPCD_BACKGROUND))
                                logger(LOG_INFO, "waiting for carrier");
                        state->state = STATE_CARRIER;
                        tv.tv_sec = options->timeout;
@@ -1683,7 +1683,7 @@ dhcp_run(const struct options *options, int *pid_fd)
 
        state->signal_fd = signal_fd();
 
-       if (state->options & DHCPCD_NOWAIT)
+       if (state->options & DHCPCD_BACKGROUND)
                if (daemonise(state, options) == -1)
                        goto eexit;
 
index 16717733a7eae62eb20f623e70ce8bda9653d4ab..f5565b35f509bf06825a4cbaafd88d242b74547a 100644 (file)
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd Jul 16, 2008
+.Dd Jul 18, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
 .Nd an RFC 2131 compliant DHCP client
 .Sh SYNOPSIS
 .Nm
-.Op Fl dknpqADEGKLSTVWX
+.Op Fl bdknpqADEGKLSTVX
 .Op Fl c , -script Ar script
 .Op Fl f , -config Ar file
 .Op Fl h , -hostname Ar hostname
@@ -124,6 +124,10 @@ You can fine tune the behaviour of
 .Nm
 with the following options:
 .Bl -tag -width indent
+.It Fl b , -background
+Background immediately.
+This is useful for startup scripts which don't disable link messages for
+carrier status.
 .It Fl c , -script Ar script
 Use this
 .Ar script
@@ -299,10 +303,6 @@ itself never does any DNS updates.
 Change the default clientid sent from the interface hardware address.
 If the string is of the format 01:02:03 then it is encoded as hex.
 If not set then none is sent.
-.It Fl W , -nowait
-Don't wait for a DHCP lease, background immediately.
-This is useful for startup scripts which don't disable link messages for
-carrier status.
 .El
 .Ss Restriciting behaviour
 .Nm
index 9b55de5accd2eb915788ee3a30d04f9f0cbefcb5..1ca50c64ad28e535f80f88061af8c0c12321c7e3 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -52,11 +52,12 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples";
 
 /* Don't set any optional arguments here so we retain POSIX
  * compatibility with getopt */
-#define OPTS "c:df:h:i:kl:m:no:pqr:s:t:u:v:xAC:DEF:GI:KLO:TVWX"
+#define OPTS "bc:df:h:i:kl:m:no:pqr:s:t:u:v:xAC:DEF:GI:KLO:TVX"
 
 static int doversion = 0;
 static int dohelp = 0;
 static const struct option longopts[] = {
+       {"background",  no_argument,        NULL, 'b'},
        {"script",      required_argument,  NULL, 'c'},
        {"debug",       no_argument,        NULL, 'd'},
        {"config",      required_argument,  NULL, 'f'},
@@ -87,8 +88,6 @@ static const struct option longopts[] = {
        {"nooption",    optional_argument,  NULL, 'O'},
        {"test",        no_argument,        NULL, 'T'},
        {"variables",   no_argument,        NULL, 'V'},
-       {"nowait",      no_argument,        NULL, 'W'},
-       {"nodaemonise", no_argument,        NULL, 'X'},
        {"help",        no_argument,        &dohelp, 1},
        {"version",     no_argument,        &doversion, 1},
 #ifdef THERE_IS_NO_FORK
@@ -321,6 +320,9 @@ parse_option(int opt, char *oarg, struct options *options)
 #endif
 
        switch(opt) {
+       case 'b':
+               options->options |= DHCPCD_BACKGROUND;
+               break;
        case 'c':
                strlcpy(options->script, oarg, sizeof(options->script));
                break;
@@ -555,9 +557,6 @@ parse_option(int opt, char *oarg, struct options *options)
                        return -1;
                }
                break;
-       case 'W':
-               options->options |= DHCPCD_NOWAIT;
-               break;
        case 'X':
                options->options &= ~DHCPCD_DAEMONISE;
                break;
index c6c98504d6c07012b9b712bd4c3754993e7409cf..a46c6fc7b51be2c06fa43c26e3d477e725837136 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -69,7 +69,7 @@ extern char *dhcpcd_skiproutes;
 #define DHCPCD_HOSTNAME                (1 << 18)
 #define DHCPCD_CLIENTID                (1 << 19)
 #define DHCPCD_LINK            (1 << 20)
-#define DHCPCD_NOWAIT          (1 << 21)
+#define DHCPCD_BACKGROUND      (1 << 21)
 
 struct options {
        char interface[IF_NAMESIZE];