Merge branch 'master' of git.dolda2000.com:/srv/git/r/ashd
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 27 Dec 2012 17:42:17 +0000 (18:42 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 27 Dec 2012 17:42:17 +0000 (18:42 +0100)
src/htparser.c
src/ssl-gnutls.c

index 5dfed8b..e6f545a 100644 (file)
@@ -426,8 +426,8 @@ static void initroot(void *uu)
 {
     int fd;
     
+    setsid();
     if(daemonize) {
-       setsid();
        chdir("/");
        if((fd = open("/dev/null", O_RDWR)) >= 0) {
            dup2(fd, 0);
index 24c8752..d4862d4 100644 (file)
@@ -607,9 +607,9 @@ void handlegnussl(int argc, char **argp, char **argv)
     pd->creds = creds;
     pd->ncreds = ncreds.b;
     mustart(listenloop, pd);
-    if((fd = listensock6(port)) < 0) {
+    if((fd = listensock4(port)) < 0) {
        if(errno != EADDRINUSE) {
-           flog(LOG_ERR, "could not listen on IPv6 port (port %i): %s", port, strerror(errno));
+           flog(LOG_ERR, "could not listen on IPv4 port (port %i): %s", port, strerror(errno));
            exit(1);
        }
     } else {