From owner-p4-projects@FreeBSD.ORG  Thu Dec  2 20:36:42 2004
Return-Path: <owner-p4-projects@FreeBSD.ORG>
Delivered-To: p4-projects@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 59E1316A4D0; Thu,  2 Dec 2004 20:36:42 +0000 (GMT)
Delivered-To: perforce@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 350A416A4CE
	for <perforce@freebsd.org>; Thu,  2 Dec 2004 20:36:42 +0000 (GMT)
Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 293D143D2F
	for <perforce@freebsd.org>; Thu,  2 Dec 2004 20:36:42 +0000 (GMT)
	(envelope-from sam@freebsd.org)
Received: from repoman.freebsd.org (localhost [127.0.0.1])
	by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iB2Kag20000759
	for <perforce@freebsd.org>; Thu, 2 Dec 2004 20:36:42 GMT
	(envelope-from sam@freebsd.org)
Received: (from perforce@localhost)
	by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iB2KafAv000756
	for perforce@freebsd.org; Thu, 2 Dec 2004 20:36:41 GMT
	(envelope-from sam@freebsd.org)
Date: Thu, 2 Dec 2004 20:36:41 GMT
Message-Id: <200412022036.iB2KafAv000756@repoman.freebsd.org>
X-Authentication-Warning: repoman.freebsd.org: perforce set sender to
	sam@freebsd.org using -f
From: Sam Leffler <sam@FreeBSD.org>
To: Perforce Change Reviews <perforce@freebsd.org>
Subject: PERFORCE change 66273 for review
X-BeenThere: p4-projects@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: p4 projects tree changes <p4-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/p4-projects>,
	<mailto:p4-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/p4-projects>
List-Post: <mailto:p4-projects@freebsd.org>
List-Help: <mailto:p4-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/p4-projects>,
	<mailto:p4-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Dec 2004 20:36:43 -0000

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);