From: Fredrik Tolf Date: Thu, 27 Dec 2012 07:15:14 +0000 (+0100) Subject: htparser: Put root handler in a new session regardless of daemonization. X-Git-Tag: 0.12~23 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=cf91aa538e5215bc1981d11d06cb6e6c0c221c22 htparser: Put root handler in a new session regardless of daemonization. --- diff --git a/src/htparser.c b/src/htparser.c index c1903b4..766d2f5 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -425,8 +425,8 @@ static void initroot(void *uu) { int fd; + setsid(); if(daemonize) { - setsid(); chdir("/"); if((fd = open("/dev/null", O_RDWR)) >= 0) { dup2(fd, 0);