From edb4171823339e82093e7fc428091e3a0bf9ea1d Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Fri, 26 Nov 2004 02:56:16 +0000 Subject: [PATCH] Alejandro Mery: * Add option (-a) to dhcpcd to not detach after getting dhcp's answer. [2004110522524721598] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@4825 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/stf/dhcpcd/nodetach_option.patch | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 package/stf/dhcpcd/nodetach_option.patch diff --git a/package/stf/dhcpcd/nodetach_option.patch b/package/stf/dhcpcd/nodetach_option.patch new file mode 100644 index 000000000..c5984967b --- /dev/null +++ b/package/stf/dhcpcd/nodetach_option.patch @@ -0,0 +1,53 @@ +--- ./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 );