@@ 152,18 152,18 @@ main(int argc, char** argv) {
cleanup();
}
+ if(ctxt.daemon) if(daemon(0, 0)) {
+ perror("cannot create daemon");
+ ctxt.error = E_SYS;
+ cleanup();
+ }
+
if(signal(SIGINT, &cleanup) == SIG_IGN)
signal(SIGINT, SIG_IGN);
if(signal(SIGHUP, &cleanup) == SIG_IGN)
signal(SIGHUP, SIG_IGN);
if(signal(SIGTERM, &cleanup) == SIG_IGN)
signal(SIGTERM, SIG_IGN);
-
- if(ctxt.daemon) if(daemon(0, 0)) {
- perror("cannot create daemon");
- ctxt.error = E_SYS;
- cleanup();
- }
while(1) if((ctxt.cfd = cliaccpt(ctxt.sfd)) >= 0) {
srv(ctxt.cfd);