Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 1996 09:39:45 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        jmacd@CS.Berkeley.EDU (Josh MacDonald)
Cc:        joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@freebsd.org
Subject:   Re: stdio problem
Message-ID:  <199605030009.JAA01340@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199605022220.PAA17967@paris.CS.Berkeley.EDU> from "Josh MacDonald" at May 2, 96 03:20:21 pm

next in thread | previous in thread | raw e-mail | index | archive | help
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  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605030009.JAA01340>