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