]> git.tuebingen.mpg.de Git - dss.git/blobdiff - daemon.c
Revert "ipc.c: Use ftok() instead of SuperFastHash."
[dss.git] / daemon.c
index fe51fe03a5c614ba4cc8f34a0f29e1b79cd2cf8d..86e89066aedf048757cc2f4e55674e909a0168a0 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1997-2010 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2010 Andre Noll <maan@tuebingen.mpg.de>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -19,9 +19,9 @@
 #include <stdio.h>
 
 #include "gcc-compat.h"
-#include "error.h"
+#include "err.h"
 #include "log.h"
-#include "string.h"
+#include "str.h"
 #include "daemon.h"
 
 /**
@@ -45,10 +45,8 @@ void daemon_init(void)
        /* become session leader */
        if (setsid() < 0)
                goto err;
-       if (chdir("/") < 0)
-               goto err;
        umask(0);
-       null = open("/dev/null", O_RDONLY);
+       null = open("/dev/null", O_RDWR);
        if (null < 0)
                goto err;
        if (dup2(null, STDIN_FILENO) < 0)