From owner-freebsd-hackers Thu May 2 17:08:32 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA07003 for hackers-outgoing; Thu, 2 May 1996 17:08:32 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id RAA06988 for ; Thu, 2 May 1996 17:08:13 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id JAA01340; Fri, 3 May 1996 09:39:45 +0930 From: Michael Smith Message-Id: <199605030009.JAA01340@genesis.atrad.adelaide.edu.au> Subject: Re: stdio problem To: jmacd@CS.Berkeley.EDU (Josh MacDonald) Date: Fri, 3 May 1996 09:39:45 +0930 (CST) Cc: joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@freebsd.org In-Reply-To: <199605022220.PAA17967@paris.CS.Berkeley.EDU> from "Josh MacDonald" at May 2, 96 03:20:21 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Josh MacDonald stands accused of saying: > > Unfortunatly, I don't have control over this condition. I am closing > the standard input and exec-ing GNU diff3. Diff3 calls freopen. > The comments in stdio/freopen.c say this should work. It works everywhere > else. "Why doesn't your operating system support my broken software?" > Why couldn't you all just answer my questions instead of telling me > it is wrong. Obviously, I already know that > it doesn't work on FreeBSD or NetBSD, and that it works on every other > operating system I've tried it on. > > a) Why does freopen fail *even though the comments in freopen.c say > it should not*? Read the source. Watch it in action. Learn for yourself. > b) Should GNU diff3 be responsible for checking that stdin is open > before tring to freopen? > > c) Should I not exec a program without an opened stdin? Programs > which assume they have an open stdin are bad, I think. A program has to make a few basic assumptions. I think that expecting that fd 0 is open is not terribly unreasonable. Is there any particular reason _why_ you feel that you have to close stdin? > -josh -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[