htparser: Put root handler in a new session regardless of daemonization.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 27 Dec 2012 07:15:14 +0000 (08:15 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 27 Dec 2012 07:15:14 +0000 (08:15 +0100)
src/htparser.c

index c1903b4..766d2f5 100644 (file)
@@ -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);