From 7a3a386b9e6c1ad00f7fb4f57c32178974203a05 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 12 Apr 2004 07:26:23 -0400 Subject: [PATCH] In the blkid library, if the BLKID_FILE environment variable is set, use it to find the blkid.tab file if the calling application did not supply a filename. --- lib/blkid/ChangeLog | 6 ++++++ lib/blkid/cache.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 022b4ba..4db38b0 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,9 @@ +2004-04-12 Theodore Ts'o + + * cache.c (blkid_get_cache): If the BLKID_FILE environment + variable is set, use it to find the blkid.tab file if the + calling application did not supply a filename. + 2004-04-03 Theodore Ts'o * Makefile.in: Update the modtime even if subst doesn't need to diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c index 5d824d2..d0c41ba 100644 --- a/lib/blkid/cache.c +++ b/lib/blkid/cache.c @@ -39,7 +39,11 @@ int blkid_get_cache(blkid_cache *ret_cache, const char *filename) INIT_LIST_HEAD(&cache->bic_devs); INIT_LIST_HEAD(&cache->bic_tags); - if (!filename || !strlen(filename)) + if (filename && !strlen(filename)) + filename = 0; + if (!filename) + filename = getenv("BLKID_FILE"); + if (!filename) filename = BLKID_CACHE_FILE; cache->bic_filename = blkid_strdup(filename); -- 1.8.3.1