bug-gnulib
[Top][All Lists]
Advanced

[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 10:12:07 -0400 (EDT)

Bruno Haible writes:
> 
> But the code assumes that stdin and stderr have not been closed (since
> in some case these streams are used).

They may have been closed and reopened.  In general, I don't think
there's anything that says a user isn't allowed to do:

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

> This should be documented. Then
> there is no need for an auxiliary variable - because assuming that
> stdin has not been closed, fopen(something) cannot return stdin.

If you go that route, then make very sure that the code relies only on
exactly what you document.

-Larry Jones

Any game without push-ups, hits, burns or noogies is a sissy game. -- Calvin




reply via email to

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