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