Re: [dev] [sdhcp] [PATCH 1/2] Only fork once
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 && (forked = fork()))
exit(EXIT_SUCCESS);
but that is a little bit confusing.
--Markus
Received on Mon Apr 27 2015 - 10:35:01 CEST
This archive was generated by hypermail 2.3.0
: Mon Apr 27 2015 - 10:36:25 CEST