Re: [dev] [sdhcp] [PATCH 1/2] Only fork once

2015-04-27 Thread Hiltjo Posthuma
On Mon, Apr 27, 2015 at 3:00 AM, Michael Forney mfor...@mforney.org wrote: --- Thanks for contributing! I have applied both patches and added you to the LICENSE file. Kind regards, Hiltjo

Re: [dev] [sdhcp] [PATCH 1/2] Only fork once

2015-04-27 Thread Markus Teich
Michael Forney wrote: + if(!forked) { + if(fork()) + exit(EXIT_SUCCESS); + forked = 1; + } Heyho, why not: if(!forked fork()) exit(EXIT_SUCCESS); forked = 1; You could also use if(!forked

[dev] [sdhcp] [PATCH 1/2] Only fork once

2015-04-26 Thread Michael Forney
--- 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