diff options
author | Paul Lindner <plindner@hi5.com> | 2007-04-13 20:20:07 +0000 |
---|---|---|
committer | Paul Lindner <plindner@hi5.com> | 2007-04-13 20:20:07 +0000 |
commit | e31164ede9081d5aedb47028eabdac7d1063f9ae (patch) | |
tree | 93bb6a3becc2e5e3e6d505a1eeb22879299fd56d /daemon.c | |
parent | 3f2f8c700b6612cc290809f1fff24c2dc74e7913 (diff) | |
download | memcached-e31164ede9081d5aedb47028eabdac7d1063f9ae.tar.gz |
Ansi C and small logic tweaks
git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@505 b0b603af-a30f-0410-a34e-baf09ae79d0b
Diffstat (limited to 'daemon.c')
-rw-r--r-- | daemon.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -38,9 +38,7 @@ #include <stdlib.h> #include <unistd.h> -int -daemon(nochdir, noclose) - int nochdir, noclose; +int daemon(int nochdir, int noclose) { int fd; @@ -56,10 +54,10 @@ daemon(nochdir, noclose) if (setsid() == -1) return (-1); - if (!nochdir) + if (nochdir == 0) (void)chdir("/"); - if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { + if (noclose==0 && (fd = open("/dev/null", O_RDWR, 0)) != -1) { (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDERR_FILENO); |