delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/13/20:20:13

From: earnie_boyd AT yahoo DOT com (Earnie Boyd)
Subject: Re: Error in dup???
13 Nov 1998 20:20:13 -0800 :
Message-ID: <19981114041054.582.rocketmail.cygnus.cygwin32.developers@send1b.yahoomail.com>
Reply-To: earnie_boyd AT yahoo DOT com
Mime-Version: 1.0
To: cygwin developers <cygwin32-developers AT cygnus DOT com>

---Corinna Vinschen <corinna DOT vinschen AT cityweb DOT de> wrote:
<snip> 
> 	...
> 	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.

<snip> 
> 	...
> 	close(0);
> 	(void) dup2(foo_fd, 0);
> 	...

For systems that support dup2 this would be more correct.


==
-                        \\||//
-------------------o0O0--Earnie--0O0o-------------------
--                earnie_boyd AT yahoo DOT com               --
-- http://www.freeyellow.com/members5/gw32/index.html --
----------------------ooo0O--O0ooo----------------------

PS: Newbie's, you should visit my page.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019