mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 22:05:23 +00:00
Add nowait flag. Remove -D flag.
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#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 local_port;
|
||||||
u_int16_t remote_port;
|
u_int16_t remote_port;
|
||||||
int no_daemon;
|
int no_daemon;
|
||||||
int save_scripts;
|
|
||||||
struct string_list *client_env;
|
struct string_list *client_env;
|
||||||
int client_env_count;
|
int client_env_count;
|
||||||
int onetry;
|
int onetry;
|
||||||
int quiet;
|
int quiet;
|
||||||
|
int nowait;
|
||||||
|
|
||||||
static void usage PROTO ((void));
|
static void usage PROTO ((void));
|
||||||
|
|
||||||
@@ -159,8 +159,6 @@ int main (argc, argv, envp)
|
|||||||
ntohs (local_port));
|
ntohs (local_port));
|
||||||
} else if (!strcmp (argv [i], "-d")) {
|
} else if (!strcmp (argv [i], "-d")) {
|
||||||
no_daemon = 1;
|
no_daemon = 1;
|
||||||
} else if (!strcmp (argv [i], "-D")) {
|
|
||||||
save_scripts = 1;
|
|
||||||
} else if (!strcmp (argv [i], "-pf")) {
|
} else if (!strcmp (argv [i], "-pf")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
@@ -216,6 +214,8 @@ int main (argc, argv, envp)
|
|||||||
} else if (!strcmp (argv [i], "--version")) {
|
} else if (!strcmp (argv [i], "--version")) {
|
||||||
log_info ("isc-dhclient-%s", DHCP_VERSION);
|
log_info ("isc-dhclient-%s", DHCP_VERSION);
|
||||||
exit (0);
|
exit (0);
|
||||||
|
} else if (!strcmp (argv [i], "-nw")) {
|
||||||
|
nowait = 1;
|
||||||
} else {
|
} else {
|
||||||
struct interface_info *tmp = (struct interface_info *)0;
|
struct interface_info *tmp = (struct interface_info *)0;
|
||||||
status = interface_allocate (&tmp, MDL);
|
status = interface_allocate (&tmp, MDL);
|
||||||
@@ -451,9 +451,14 @@ int main (argc, argv, envp)
|
|||||||
dmalloc_outstanding = 0;
|
dmalloc_outstanding = 0;
|
||||||
#endif
|
#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
|
/* If we're not going to daemonize, write the pid file
|
||||||
now. */
|
now. */
|
||||||
if (no_daemon)
|
if (no_daemon || nowait)
|
||||||
write_client_pid_file ();
|
write_client_pid_file ();
|
||||||
|
|
||||||
/* Start dispatching packets and timeouts... */
|
/* Start dispatching packets and timeouts... */
|
||||||
@@ -470,7 +475,7 @@ static void usage ()
|
|||||||
log_info (arr);
|
log_info (arr);
|
||||||
log_info (url);
|
log_info (url);
|
||||||
|
|
||||||
log_error ("Usage: dhclient [-1dDqr] [-p <port>] %s",
|
log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
|
||||||
"[-s server]");
|
"[-s server]");
|
||||||
log_error (" [-cf config-file] [-lf lease-file]%s",
|
log_error (" [-cf config-file] [-lf lease-file]%s",
|
||||||
"[-pf pid-file] [-e VAR=val]");
|
"[-pf pid-file] [-e VAR=val]");
|
||||||
|
Reference in New Issue
Block a user