diff options
Diffstat (limited to 'lib/blkid/cache.c')
-rw-r--r-- | lib/blkid/cache.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c index 73900a51..2a2df13c 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); @@ -162,8 +167,6 @@ void blkid_gc_cache(blkid_cache cache) list_for_each_safe(p, pnext, &cache->bic_devs) { blkid_dev dev = list_entry(p, struct blkid_struct_dev, bid_devs); - if (!p) - break; if (stat(dev->bid_name, &st) < 0) { DBG(DEBUG_CACHE, printf("freeing %s\n", dev->bid_name)); |