summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2013-09-04 19:43:20 +0800
committerChris Mason <chris.mason@fusionio.com>2013-10-16 08:20:03 -0400
commit36dcac288e7ccdebb2b442d695656d81639d048c (patch)
tree5bff9c83bbcbb664138c125585782ddf508c0ec2 /mkfs.c
parentcdbc10729266c03aeb2eb812c17a3ef6c1ceae26 (diff)
Btrfs-progs: fix compile warning in is_ssd()
mkfs.c: In function ‘is_ssd’: mkfs.c:1168:26: warning: ignoring return value of ‘blkid_devno_to_wholedisk’, declared with attribute warn_unused_result [-Wunused-result] blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL); Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mkfs.c b/mkfs.c
index 69df39b7..9ccb4ace 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1150,6 +1150,7 @@ static int is_ssd(const char *file)
dev_t devno;
int fd;
char rotational;
+ int ret;
probe = blkid_new_probe_from_filename(file);
if (!probe)
@@ -1161,7 +1162,12 @@ static int is_ssd(const char *file)
return 0;
/* Get whole disk name (not full path) for this devno */
- blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL);
+ ret = blkid_devno_to_wholedisk(devno,
+ wholedisk, sizeof(wholedisk), NULL);
+ if (ret) {
+ blkid_free_probe(probe);
+ return 0;
+ }
snprintf(sysfs_path, PATH_MAX, "/sys/block/%s/queue/rotational",
wholedisk);