bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] getpass problem (was: Re: getline bug?)


From: Simon Josefsson
Subject: [Bug-gnulib] getpass problem (was: Re: getline bug?)
Date: Tue, 05 Oct 2004 23:47:04 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> OK, I installed the following into gnulib, so that the change is done
> systematically for all gnulib modules.  I also installed the
> coreutils-relevant part of this patch into coreutils.  There are one
> or two other coreutils-only changes but I'll note them only on
> bug-coreutils.

I got this on NetBSD 1.6 and (similar errors on) FreeBSD 4.9 & 5.2.1:

../libextra/.libs/libgnutls-extra.so: undefined reference to `fputs_unlocked'
../libextra/.libs/libgnutls-extra.so: undefined reference to `funlockfile'
../libextra/.libs/libgnutls-extra.so: undefined reference to `flockfile'
../libextra/.libs/libgnutls-extra.so: undefined reference to `fflush_unlocked'

I suspect it is because of getpass.c. I see that unlocked-io.h (which
I don't use) contain:

#undef funlockfile
#define funlockfile(x) ((void) 0)

which presumably took care of this before.  I'm not sure what a good
solution is.  Perhaps getpass need to check for funlockfile (etc)
before using them?  On the other hand, getpass isn't required to be
thread safe, so I'm not sure gnulib has to bother.  The patch below is
untested.

The getpass.c code is quite unreadable, and forked from
glibc...  Sigh.

Thanks.

--- getpass.c   04 Oct 2004 22:26:17 +0200      1.8
+++ getpass.c   05 Oct 2004 23:41:48 +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) ((void) 0)
+# undef flockfile
+# define flockfile(x) ((void) 0)
+# undef ftrylockfile
+# define ftrylockfile(x) 0
+# undef funlockfile
+# define funlockfile(x) ((void) 0)
+# undef fputs_unlocked
+# define fputs_unlocked(x,y) ((void) 0)
 #endif
 
 #if _LIBC





reply via email to

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