[memcached] plindner, r505: Ansi C and small logic tweaks

commits at code.sixapart.com commits at code.sixapart.com
Fri Apr 13 20:20:08 UTC 2007


Ansi C and small logic tweaks

U   trunk/server/daemon.c


Modified: trunk/server/daemon.c
===================================================================
--- trunk/server/daemon.c	2007-04-13 20:19:15 UTC (rev 504)
+++ trunk/server/daemon.c	2007-04-13 20:20:07 UTC (rev 505)
@@ -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 @@
     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);




More information about the memcached-commits mailing list