]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add nowait flag. Remove -D flag.
authorTed Lemon <source@isc.org>
Mon, 16 Apr 2001 22:07:33 +0000 (22:07 +0000)
committerTed Lemon <source@isc.org>
Mon, 16 Apr 2001 22:07:33 +0000 (22:07 +0000)
client/dhclient.c

index cbcda20efa11dd98fdb5c7d4ea2c8678d63bf65f..364505e1ad08224af26e5243e5ae3892c9f346c0 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.128 2001/04/09 00:34:06 mellon Exp $ Copyright (c) 1995-2001 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.129 2001/04/16 22:07:33 mellon Exp $ Copyright (c) 1995-2001 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -79,11 +79,11 @@ static char url [] = "For info, please visit http://www.isc.org/products/DHCP";
 u_int16_t local_port;
 u_int16_t remote_port;
 int no_daemon;
-int save_scripts;
 struct string_list *client_env;
 int client_env_count;
 int onetry;
 int quiet;
+int nowait;
 
 static void usage PROTO ((void));
 
@@ -159,8 +159,6 @@ int main (argc, argv, envp)
                               ntohs (local_port));
                } else if (!strcmp (argv [i], "-d")) {
                        no_daemon = 1;
-               } else if (!strcmp (argv [i], "-D")) {
-                       save_scripts = 1;
                 } else if (!strcmp (argv [i], "-pf")) {
                         if (++i == argc)
                                 usage ();
@@ -216,6 +214,8 @@ int main (argc, argv, envp)
                } else if (!strcmp (argv [i], "--version")) {
                        log_info ("isc-dhclient-%s", DHCP_VERSION);
                        exit (0);
+               } else if (!strcmp (argv [i], "-nw")) {
+                       nowait = 1;
                } else {
                    struct interface_info *tmp = (struct interface_info *)0;
                    status = interface_allocate (&tmp, MDL);
@@ -451,9 +451,14 @@ int main (argc, argv, envp)
        dmalloc_outstanding = 0;
 #endif
 
+       /* If we're not supposed to wait before getting the address,
+          don't. */
+       if (nowait)
+               go_daemon ();
+
        /* If we're not going to daemonize, write the pid file
           now. */
-       if (no_daemon)
+       if (no_daemon || nowait)
                write_client_pid_file ();
 
        /* Start dispatching packets and timeouts... */
@@ -470,7 +475,7 @@ static void usage ()
        log_info (arr);
        log_info (url);
 
-       log_error ("Usage: dhclient [-1dDqr] [-p <port>] %s",
+       log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
                   "[-s server]");
        log_error ("                [-cf config-file] [-lf lease-file]%s",
                   "[-pf pid-file] [-e VAR=val]");