Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 May 1996 21:35:37 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        jmacd@CS.Berkeley.EDU (Josh MacDonald)
Cc:        sclawson@bottles.cs.utah.edu, freebsd-hackers@FreeBSD.org
Subject:   Re: stdio problem
Message-ID:  <199605030435.VAA13496@phaeton.artisoft.com>
In-Reply-To: <199605030320.UAA18744@paris.CS.Berkeley.EDU> from "Josh MacDonald" at May 2, 96 08:20:01 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Whether I do fclose(stdin) or close(STDIN_FILENO) makes no difference,
> and in fact the same problem applies.  I am execing another program
> which then tries to freopen(...,...,stdin).

Actually, it has to do with whether the state for the fd is valid.  I
think it ought to work under "the rule of least astonishment", but
use of fclose instead of close is the correct course of action,
since there is implied state for stdin, stdout, and stderr.

If it fails with fclose() followed by freopen, then it's a bug, and
it needs to be fixed.

If it doesn't, and it only failes with close, then it's not technically
an error, but is suprising to the user -- which is nearly as bad.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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