From: "Tim Van Holder" To: , "'Eli Zaretskii'" Cc: "'Charles Sandmann'" Subject: Re: freopen/_creat(w2k) interaction [was: Re: Build problems] Date: Wed, 19 Sep 2001 09:27:29 +0200 Message-ID: <000001c140dc$8aad98e0$1ef8e0d5@pandora.be> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-reply-to: <10109171455.AA03227@clio.rice.edu> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Since I've got a working freopen patch, I'll post/commit it after I > look at it again. Pretty trivial (about 5 lines). > > > > I think that assuming handles return in previous slot is > a bad assumption; > > > this could be causing problems with programs that close > stdaux and stdprn > > > for example (they would get allocated first). > > > > So? What's wrong with that? > > Scenario (may not be real): > I close handles 3 & 4 (stdaux,stdprn). I freopen a file > structure that > was on handle 5 - it will now be on handle 3. If someone expected a > same handle (saved fileno or something) would not work. This sounded like it might provide a fix for the Perl problems that were apparently caused by the closing of stdaux and stdprn. Unfortunately, this seems not to be the case; I rebuilt perl 5.7.2 with the current CVS libc (and with libc's popen/pclose instead of the local version in Perl's djgpp.c) - spawned subprograms still have the same issues unless I disable the closing of stdaux and stdprn.