---
 sdhcp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sdhcp.c b/sdhcp.c
index aa3cef2..9ff9baf 100644
--- a/sdhcp.c
+++ b/sdhcp.c
@@ -339,6 +339,8 @@ acceptlease(void)
 static void
 run(void)
 {
+       int forked = 0;
+
 #if 0
 InitReboot:
        /* send DHCPrequest to old server */
@@ -390,8 +392,11 @@ Requesting:
        }
 Bound:
        fputs("Congrats! You should be on the 'net.\n", stdout);
-       if(fork())
-               exit(EXIT_SUCCESS);
+       if(!forked) {
+               if(fork())
+                       exit(EXIT_SUCCESS);
+               forked = 1;
+       }
        switch (dhcprecv()) {
        case DHCPoffer:
        case DHCPack:
-- 
2.1.3.1.g339ec9c


Reply via email to