bug-gnulib
[Top][All Lists]
Advanced

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

Re: secure_getenv is broken on FreeBSD.


From: Paul Eggert
Subject: Re: secure_getenv is broken on FreeBSD.
Date: Wed, 06 Feb 2013 16:14:19 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Thanks for that bug report.  I pushed the following into
gnulib master, and I hope it fixes that bug.  Does it work
for you?  (It's needed for other reasons anyway, so if it
doesn't fix your bug further patches are needed.)

---
 ChangeLog       | 9 +++++++++
 lib/unistd.in.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 4b046d3..25db57d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-02-06  Paul Eggert  <address@hidden>
+
+       unistd: avoid namespace pollution on non-glibc systems
+       * lib/unistd.in.h: #define __need_getopt before including <getopt.h>.
+       This avoids namespace pollution on non-glibc systems, by causing
+       gnulib unistd.h to behave more like glibc unistd.h.  I also hope
+       that this fixes a bug on FreeBSD, reported by Mats Erik Andersson in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00027.html>.
+
 2013-02-04  Paul Eggert  <address@hidden>
 
        tmpdir: use secure_getenv
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 7cc022d..8a25aa4 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -110,6 +110,7 @@
 /* Get getopt(), optarg, optind, opterr, optopt.
    But avoid namespace pollution on glibc systems.  */
 #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined 
_GL_SYSTEM_GETOPT
+# define __need_getopt
 # include <getopt.h>
 #endif
 
-- 
1.7.11.7





reply via email to

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