aboutsummaryrefslogtreecommitdiffstats
path: root/lib/blkid
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-06-16 14:34:59 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-06-16 14:34:59 -0400
commit1ad3174af5213fa7029944cc19723cda08f221d3 (patch)
treef976fa448d0841d5b79da49f6260f974a1a37924 /lib/blkid
parentdc9cc7006a61d0ef82ee4e1dee133998c6040765 (diff)
downloadandroid_external_e2fsprogs-1ad3174af5213fa7029944cc19723cda08f221d3.tar.gz
android_external_e2fsprogs-1ad3174af5213fa7029944cc19723cda08f221d3.tar.bz2
android_external_e2fsprogs-1ad3174af5213fa7029944cc19723cda08f221d3.zip
Try to use secure_getenv() in preference to __secure_getenv()
If secure_getenv() use it in preference to __secure_getenv(). Starting with (e)glibc version 2.17, secure_getenv() exists, while __secure_getenv() only works with shared library links (where it is a weak symbol), but not for static links with /lib/libc.a Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/blkid')
-rw-r--r--lib/blkid/cache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c
index 73900a51..8bdd2399 100644
--- a/lib/blkid/cache.c
+++ b/lib/blkid/cache.c
@@ -11,6 +11,9 @@
*/
#include "config.h"
+#if HAVE_SECURE_GETENV
+#define _GNU_SOURCE
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -49,7 +52,9 @@ static char *safe_getenv(const char *arg)
#endif
#endif
-#ifdef HAVE___SECURE_GETENV
+#if defined(HAVE_SECURE_GETENV)
+ return secure_getenv(arg);
+#elif defined(HAVE___SECURE_GETENV)
return __secure_getenv(arg);
#else
return getenv(arg);