summaryrefslogtreecommitdiffstats
path: root/libmount/src/cache.c
diff options
context:
space:
mode:
authorKarel Zak2012-06-21 10:40:43 +0200
committerKarel Zak2012-06-21 10:40:43 +0200
commitdefa0710b63096f96b5616090c262d30b01bc60c (patch)
tree78e997be96600df083f7bca8c704c0352605b190 /libmount/src/cache.c
parentlib/sysfs: use warn_unused_result for sysfs_init() (diff)
downloadkernel-qcow2-util-linux-defa0710b63096f96b5616090c262d30b01bc60c.tar.gz
kernel-qcow2-util-linux-defa0710b63096f96b5616090c262d30b01bc60c.tar.xz
kernel-qcow2-util-linux-defa0710b63096f96b5616090c262d30b01bc60c.zip
lib/loopdev: use warn_unused_result forimportant functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/cache.c')
-rw-r--r--libmount/src/cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmount/src/cache.c b/libmount/src/cache.c
index fe9c821e1..220a1465e 100644
--- a/libmount/src/cache.c
+++ b/libmount/src/cache.c
@@ -487,8 +487,8 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
if (strncmp(pretty, "/dev/loop", 9) == 0) {
struct loopdev_cxt lc;
- loopcxt_init(&lc, 0);
- loopcxt_set_device(&lc, pretty);
+ if (loopcxt_init(&lc, 0) || loopcxt_set_device(&lc, pretty))
+ goto done;
if (loopcxt_is_autoclear(&lc)) {
char *tmp = loopcxt_get_backing_file(&lc);
@@ -502,6 +502,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
}
+done:
/* don't return pointer to the cache, allocate a new string */
return cache ? strdup(pretty) : pretty;
}