Re: A question to lib/libc/gen/daemon.c

2005-08-22 Thread Alexander Farber
Thanks. I've also read the chapter about dup's from the Stevens book and realized, that you always have to check the fd number you're going to close() after a dup2() But how can the argc be less than 1? When is it the case? After an exec()? 2005/8/22, Todd C. Miller [EMAIL PROTECTED]: Nope.

A question to lib/libc/gen/daemon.c

2005-08-21 Thread Alexander Farber
In the file /usr/src/lib/libc/gen/daemon.c if (!noclose (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDERR_FILENO); if (fd 2)

Re: A question to lib/libc/gen/daemon.c

2005-08-21 Thread Hannah Schroeter
Hello! On Sun, Aug 21, 2005 at 09:54:06AM +0200, Alexander Farber wrote: if (!noclose (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { (void)dup2(fd, 0); (void)dup2(fd, 1); (void)dup2(fd, 2); if (fd 2)

Re: A question to lib/libc/gen/daemon.c

2005-08-21 Thread Todd C. Miller
In message [EMAIL PROTECTED] so spake Alexander Farber (alexander.farber): In the file /usr/src/lib/libc/gen/daemon.c if (!noclose (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { (void)dup2(fd, STDIN_FILENO); (void)dup2(fd, STDOUT_FILENO);