diff options
author | Cyril Brulebois <kibi@debian.org> | 2009-07-24 17:42:08 +0200 |
---|---|---|
committer | LaMont Jones <lamont@debian.org> | 2009-07-24 10:18:06 -0600 |
commit | c0f07c8b674f8cb6280925711bf40b95fad2fd2d (patch) | |
tree | 096785d52dd02fd9ff0251f9903c4cf37766b1d5 /lib | |
parent | 375f9a1fcb2f3e084082239ac5405798fbd90223 (diff) | |
download | util-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.c | 5 |
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; |