Changeset 505

Show
Ignore:
Timestamp:
04/13/07 20:20:07 (2 years ago)
Author:
plindner
Message:

Ansi C and small logic tweaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/server/daemon.c

    r500 r505  
    3939#include <unistd.h> 
    4040 
    41 int 
    42 daemon(nochdir, noclose) 
    43     int nochdir, noclose; 
     41int daemon(int nochdir, int noclose) 
    4442{ 
    4543    int fd; 
     
    5755        return (-1); 
    5856 
    59     if (!nochdir
     57    if (nochdir == 0
    6058        (void)chdir("/"); 
    6159 
    62     if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { 
     60    if (noclose==0 && (fd = open("/dev/null", O_RDWR, 0)) != -1) { 
    6361        (void)dup2(fd, STDIN_FILENO); 
    6462        (void)dup2(fd, STDOUT_FILENO);