From: cgf AT cygnus DOT com (Christopher Faylor) Subject: Re: Error in dup??? 13 Nov 1998 20:50:13 -0800 Message-ID: <19981113232513.A6327.cygnus.cygwin32.developers@cygnus.com> References: <19981114041054 DOT 582 DOT rocketmail AT send1b DOT yahoomail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: earnie_boyd AT yahoo DOT com, cygwin developers On Fri, Nov 13, 1998 at 08:10:54PM -0800, Earnie Boyd wrote: >---Corinna Vinschen wrote: > >> ... >> close(0); >> (void) dup(foo_fd); >> ... >> > >It appears that the coder is assuming that dup will use the first >available file descriptor. This may not be true in all cases. No. It should be true in all cases. Dup should always choose the lowest fd. -chris