bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] Re: getpass problem


From: Simon Josefsson
Subject: [Bug-gnulib] Re: getpass problem
Date: Tue, 12 Oct 2004 16:04:49 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Simon Josefsson <address@hidden> writes:
>
>> The patch below is untested.
>
> It sounds like a reasonable first cut, but it ought to be
> bested before we put it in.
>
>> +# undef fflush_unlocked
>> +# define fflush_unlocked(x) ((void) 0)
>
> Surely this should be defined to be fflush rather than a no-op?
> Similarly for fputs_unlocked.

I tested the following patch by building on various platforms, but not
by running the code.  It looks good, though.  I have installed it.

Alternatively, getpass.c could be rewritten to use fflush etc
directly, like other files that are set up to use unlocked IO.  And
maybe it could be synced with glibc, although I don't understand all
the differences.

2004-10-12  Simon Josefsson  <address@hidden>

        * getpass.c (fflush_unlocked, flockfile, funlockfile)
        (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
        to real functions.

--- getpass.c   04 Oct 2004 22:26:17 +0200      1.8
+++ getpass.c   12 Oct 2004 15:27:43 +0200      
@@ -57,6 +57,17 @@
 # define funlockfile(s) _IO_funlockfile (s)
 #elif USE_UNLOCKED_IO
 # include "unlocked-io.h"
+#else
+# undef fflush_unlocked
+# define fflush_unlocked(x) fflush (x)
+# undef flockfile
+# define flockfile(x) ((void) 0)
+# undef funlockfile
+# define funlockfile(x) ((void) 0)
+# undef fputs_unlocked
+# define fputs_unlocked(str,stream) fputs (str, stream)
+# undef putc_unlocked
+# define putc_unlocked(c,stream) putc (c, stream)
 #endif
 
 #if _LIBC





reply via email to

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