Whamcloud - gitweb
In the blkid library, if the BLKID_FILE environment
authorTheodore Ts'o <tytso@mit.edu>
Mon, 12 Apr 2004 11:26:23 +0000 (07:26 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 12 Apr 2004 11:26:23 +0000 (07:26 -0400)
variable is set, use it to find the blkid.tab file if the
calling application did not supply a filename.

lib/blkid/ChangeLog
lib/blkid/cache.c

index 022b4ba..4db38b0 100644 (file)
@@ -1,3 +1,9 @@
+2004-04-12  Theodore Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * Makefile.in: Update the modtime even if subst doesn't need to
index 5d824d2..d0c41ba 100644 (file)
@@ -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);