Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Dec 2004 20:36:41 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 66273 for review
Message-ID:  <200412022036.iB2KafAv000756@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=66273

Change 66273 by sam@sam_ebb on 2004/12/02 20:35:55

	add -b (background) option to replace old -nw option;
	may need to change it to be backwards compatible but
	-nw isn't getopt friendly

Affected files ...

.. //depot/projects/wifi/sbin/dhclient/dhclient.c#3 edit

Differences ...

==== //depot/projects/wifi/sbin/dhclient/dhclient.c#3 (text+ko) ====

@@ -259,14 +259,18 @@
 	extern char		*__progname;
 	int			 ch, fd, quiet = 0, i = 0;
 	int			 pipe_fd[2];
+	int			 immediate_daemon = 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, "c:dl:qu")) != -1)
+	while ((ch = getopt(argc, argv, "bc:dl:nqu")) != -1)
 		switch (ch) {
+		case 'b':
+			immediate_daemon = 1;
+			break;
 		case 'c':
 			path_dhclient_conf = optarg;
 			break;
@@ -379,6 +383,9 @@
 
 	setproctitle("%s", ifi->name);
 
+	if (immediate_daemon)
+		go_daemon();
+
 	ifi->client->state = S_INIT;
 	state_reboot(ifi);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412022036.iB2KafAv000756>