Re: [dev] [surf] [patch] Close stdout after printing XID

From: Truls Becken <truls.becken_AT_gmail.com>
Date: Mon, 20 Feb 2012 09:10:15 +0100

On 2012-02-19, at 13:47, Abby Cedar wrote:

>> Am I missing something? Why not just use flose(stdout)?
>
> Using only fclose would result in Bad file descriptor errors on future
> attempts to write to stdout. freopen is cleaner.

And so it becomes a philosophical question. When you close a file descriptor,
it's because you're not going to use it any more. If the programmer forgets
and writes to stdout anyway, is it better to have the program exit with an
error, or to hide the problem so that nobody discovers the bug?

-Truls
Received on Mon Feb 20 2012 - 09:10:15 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 09:12:04 CET