Package: util-linux
Version: 2.16-2
Severity: important
Tags: patch
User: glibc-bsd-de...@lists.alioth.debian.org
Usertags: kfreebsd

Hi,

just to make sure a trace of that patch is kept, I'm opening a bug.
Mainly so that other porters know that a patch is available.

As a reminder, GNU/kFreeBSD really need to get util-linux in unstable
ASAP so that we finally can get hal built, making it possible to take
care of both the kde and gnome stacks.

Mraw,
KiBi.
>From f2bc4996a4d642f3eb6f93609a7e71491df71867 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <k...@debian.org>
Date: Thu, 23 Jul 2009 02:45:36 +0200
Subject: [PATCH] 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 <k...@debian.org>
---
 lib/fsprobe.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/lib/fsprobe.c b/lib/fsprobe.c
index b47de0e..04360dc 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;
-- 
1.6.3.3

Reply via email to