[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] getpass echoes on many systems

From: Larry Jones
Subject: Re: [Bug-gnulib] getpass echoes on many systems
Date: Thu, 2 Oct 2003 00:52:42 -0400 (EDT)

Paul Eggert writes:
> But I don't see anywhere where the C or POSIX standards prohibit fopen
> from returning stdin.

Indeed; I hadn't considered the case where stdin and/or stderr has been
closed.  In that case, it's also possible that stdin == stderr:

        fclose (stderr);
        fclose (stdin);
        stderr = fopen ("/dev/null", "r");

So neither test is reliable -- we need an auxiliary variable instead.

-Larry Jones

I've got an idea for a sit-com called "Father Knows Zilch." -- Calvin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]