summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2009-07-24 17:42:08 +0200
committerLaMont Jones <lamont@debian.org>2009-07-24 10:18:06 -0600
commitc0f07c8b674f8cb6280925711bf40b95fad2fd2d (patch)
tree096785d52dd02fd9ff0251f9903c4cf37766b1d5 /lib
parent375f9a1fcb2f3e084082239ac5405798fbd90223 (diff)
downloadutil-linux-old-c0f07c8b674f8cb6280925711bf40b95fad2fd2d.tar.gz
Only check for ENOMEDIUM when ENOMEDIUM is defined.
ENOMEDIUM is Linux-only. On other systems, the open call on a CD-ROM device without any medium may be successful and a subsequent read may return EINVAL instead. Let's just break out of the loop if ENOMEDIUM isn't defined. Signed-off-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: LaMont Jones <lamont@debian.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/fsprobe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/fsprobe.c b/lib/fsprobe.c
index b47de0ec..04360dc8 100644
--- a/lib/fsprobe.c
+++ b/lib/fsprobe.c
@@ -31,8 +31,13 @@ open_device(const char *devname)
int fd = open(devname, O_RDONLY);
if (fd >= 0)
return fd;
+#ifdef ENOMEDIUM
+ /* ENOMEDIUM is Linux-only */
if (errno != ENOMEDIUM)
break;
+#else
+ break
+#endif
if (retries >= CRDOM_NOMEDIUM_RETRIES)
break;
++retries;