Mail Archives: cygwin/2003/06/10/06:52:16
On Tue, Jun 10, 2003 at 11:52:57AM +0200, Bjoern Kahl AG Resy wrote:
> > > +#ifdef __CYGWIN__
> > > + {
> > > + int fd;
> > > + if ((fd = open("/dev/null", O_RDWR, 0)) != -1)
> > > + {
> > > + (void)dup2(fd, STDIN_FILENO);
> > > + (void)dup2(fd, STDOUT_FILENO);
> > > + (void)dup2(fd, STDERR_FILENO);
> > > + if (fd > 2)
> > > + (void)close (fd);
>
> Should not this read :
>
> if ( (fd != STDIN_FILENO) && (fd != STDOUT_FILENO) & .. )
>
> If you already use symbolic constants for the file descriptors?
> Just imagine a weird system, having e.g. STDOUT_FILENO defined
> as 3. (I doubt, something like that exist, but who knows?)
There's only one weird system which has __CYGWIN__ defined...
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -