Skip to content

Commit

Permalink
Ansi C and small logic tweaks
Browse files Browse the repository at this point in the history
git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@505 b0b603af-a30f-0410-a34e-baf09ae79d0b
  • Loading branch information
plindner committed Apr 13, 2007
1 parent 95aa914 commit 27ec682
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 27ec682

Please sign in to comment.