summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2013-07-26 01:35:30 +0800
committerDavid Sterba <dsterba@suse.cz>2013-09-03 19:40:44 +0200
commit1c1725a07b384e13300b99ecf6816b6f78615691 (patch)
tree98577fef9cc1cf0d5046d9eaf8f68f56de36fdd5
parenta2fc3b5113c982f0263eb336daa4234f5a47e914 (diff)
btrfs-progs: don't have to report ENOMEDIUM error during open
when we scan /proc/partitions the cdrom is scanned as well, and we don't have to report ENOMEDIUM errors against it. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 46f502d6..6b4c4a7b 100644
--- a/utils.c
+++ b/utils.c
@@ -1438,8 +1438,9 @@ scan_again:
fd = open(fullpath, O_RDONLY);
if (fd < 0) {
- fprintf(stderr, "failed to open %s: %s\n",
- fullpath, strerror(errno));
+ if (errno != ENOMEDIUM)
+ fprintf(stderr, "failed to open %s: %s\n",
+ fullpath, strerror(errno));
continue;
}
ret = btrfs_scan_one_device(fd, fullpath, &tmp_devices,