Changeset 505
- Timestamp:
- 04/13/07 20:20:07 (2 years ago)
- Files:
-
- trunk/server/daemon.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/server/daemon.c
r500 r505 39 39 #include <unistd.h> 40 40 41 int 42 daemon(nochdir, noclose) 43 int nochdir, noclose; 41 int daemon(int nochdir, int noclose) 44 42 { 45 43 int fd; … … 57 55 return (-1); 58 56 59 if ( !nochdir)57 if (nochdir == 0) 60 58 (void)chdir("/"); 61 59 62 if ( !noclose&& (fd = open("/dev/null", O_RDWR, 0)) != -1) {60 if (noclose==0 && (fd = open("/dev/null", O_RDWR, 0)) != -1) { 63 61 (void)dup2(fd, STDIN_FILENO); 64 62 (void)dup2(fd, STDOUT_FILENO);
