diff options
author | Karel Zak | 2012-06-21 10:40:43 +0200 |
---|---|---|
committer | Karel Zak | 2012-06-21 10:40:43 +0200 |
commit | defa0710b63096f96b5616090c262d30b01bc60c (patch) | |
tree | 78e997be96600df083f7bca8c704c0352605b190 /libmount/src/cache.c | |
parent | lib/sysfs: use warn_unused_result for sysfs_init() (diff) | |
download | kernel-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.c | 5 |
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; } |