]> err.no Git - util-linux/commitdiff
blkid: fix gcc warning in blkid_get_cache_filename()
authorKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2009 15:06:52 +0000 (16:06 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2009 15:06:52 +0000 (16:06 +0100)
cache.c: In function `blkid_get_cache_filename':
cache.c:113  warning: return makes pointer from integer without a cast

Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/cache.c

index 3dd40d094810540cc1b5630a277eb1ae994db4ef..d2b54f23da322a34ceef6ef3371ae9f0611617a2 100644 (file)
@@ -110,10 +110,12 @@ char *blkid_get_cache_filename(struct blkid_config *conf)
        else {
                struct blkid_config *c = blkid_read_config(NULL);
                if (!c)
-                       return -BLKID_ERR_PARAM;
-               filename = c->cachefile;  /* already allocated */
-               c->cachefile = NULL;
-               blkid_free_config(c);
+                       filename = blkid_strdup(BLKID_CONFIG_FILE);
+               else {
+                       filename = c->cachefile;  /* already allocated */
+                       c->cachefile = NULL;
+                       blkid_free_config(c);
+               }
        }
        return filename;
 }