You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../dhcpcd/nodetach_option.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- T2-COPYRIGHT-NOTE-END ---
--- ./dhcpcd.c.orig 2004-11-05 18:06:47.000000000 -0300
+++ ./dhcpcd.c 2004-11-05 18:17:19.000000000 -0300
@@ -59,6 +59,7 @@
int ReplNTPConf = 1;
int SetDomainName = 0;
int SetHostName = 0;
+int NoDetach = 0;
int BroadcastResp = 0;
time_t TimeOut = DEFAULT_TIMEOUT;
int magic_cookie = 0;
@@ -145,6 +146,10 @@
s++;
DebugFlag=1;
goto prgs;
+ case 'a':
+ s++;
+ NoDetach=1;
+ goto prgs;
case 'r':
s++;
BeRFC1541=1;
@@ -325,7 +330,7 @@
default:
usage: print_version();
fprintf(stderr,
-"Usage: dhcpcd [-dknrBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
+"Usage: dhcpcd [-adknrBCDHNRSTY] [-l leasetime] [-h hostname] [-t timeout]\n\
[-i vendorClassID] [-I ClientID] [-c filename] [-s [ipaddr]]\n\
[-w windowsize] [-L ConfigDir] [-G [gateway]] [interface]\n");
exit(1);
@@ -375,9 +380,12 @@
if ( TestCase ) exit(0);
#endif
alarm(0);
-#ifdef DEBUG
+#ifndef DEBUG
+ if ( NoDetach ) {
+#endif
writePidFile(getpid());
-#else
+#ifndef DEBUG
+ } else {
#ifdef EMBED
s=vfork();
#else
@@ -396,6 +404,7 @@
(void)dup2(i,STDERR_FILENO);
if ( i > 2 ) (void)close(i);
}
+ }
#endif
chdir("/");
do currState=(void *(*)())currState(); while ( currState );