From 4fc5d65bf26e805f3afed2bfd7fbb95f30779144 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 16 Feb 2010 09:43:26 +0100 Subject: [PATCH] blkid: report open() errors in low-level probing Signed-off-by: Karel Zak --- misc-utils/blkid.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index 28baa2a0..8c66e0a8 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -413,9 +414,10 @@ static int lowprobe_device(blkid_probe pr, const char *devname, char *show[], struct stat st; fd = open(devname, O_RDONLY); - if (fd < 0) + if (fd < 0) { + fprintf(stderr, "error: %s: %s\n", devname, strerror(errno)); return 2; - + } if (blkid_probe_set_device(pr, fd, offset, size)) goto done; -- 2.39.5