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: Wed, 1 Oct 2003 22:48:53 -0400 (EDT)

Paul Eggert writes:
> 
> The patch that was actually installed is slightly different from what
> you proposed.  It includes <fcntl.h> unconditionally, and doesn't
> define SEEK_CUR even if the include files define it.  The latter
> change is arguably OK, as we're assuming C89 more and more.  But do we
> really need to include <fcntl.h> here?

If you're assuming C89 and really mean it, then I'd say "no".  It seems
to me (but I admit that my memory is none too good in this area) that
X3J11 got the SEEK_* macros from SysV, but SysV had them in <fcntl.h>,
which was not something J11 wanted to pick up, so we moved them to
<stdio.h>.  POSIX says they're in both places, plus <unistd.h> to boot. 
So <fcntl.h> would be appropriate to pick up a few pre-C89 systems, but
I think you'd have to conditionally define them yourself if you really
wanted to be portable to pre-C89 systems.

> There are a few other issues with gnulib getpass.c.  The "if (in !=
> stdin)" should be "if (in == out)".

Given the code in getpass, they are synonymous.  Unless, of course,
it's possible that stdin == stderr.  Or that a newly-opened stream would
compare equal to stdin.  I think the former is slightly more likely than
the latter, but I don't think either is actually valid.

-Larry Jones

What's the matter?  Don't you trust your own kid?! -- Calvin




reply via email to

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