summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorPaul Lindner <plindner@hi5.com>2007-04-13 20:20:07 +0000
committerPaul Lindner <plindner@hi5.com>2007-04-13 20:20:07 +0000
commite31164ede9081d5aedb47028eabdac7d1063f9ae (patch)
tree93bb6a3becc2e5e3e6d505a1eeb22879299fd56d /daemon.c
parent3f2f8c700b6612cc290809f1fff24c2dc74e7913 (diff)
downloadmemcached-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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/daemon.c b/daemon.c
index 5ea6df7..ef250bd 100644
--- a/daemon.c
+++ b/daemon.c
@@ -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);