diff mbox

[6/6] btrfs-progs: don't have to report ENOMEDIUM error during open

Message ID 1374773730-29957-7-git-send-email-anand.jain@oracle.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Anand Jain July 25, 2013, 5:35 p.m. UTC
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>
---
 utils.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/utils.c b/utils.c
index 4aeea9c..638cef0 100644
--- a/utils.c
+++ b/utils.c
@@ -1443,8 +1443,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,