linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Krause <chkr@plauener.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: cd-tray immediately closed after it has been opened
Date: Mon, 28 Jul 2008 08:48:07 +0000	[thread overview]
Message-ID: <488D87C7.4090407@plauener.de> (raw)
In-Reply-To: <488CCA58.7030409@plauener.de>

David Zeuthen wrote:
> On Sun, 2008-07-27 at 21:19 +0200, Christian Krause wrote:
>   
>> Before this checkin, vol_id was only called for partitioned devices and 
>> so the CD tray stayed open.
>>     
>
> Probably vol_id needs to use O_NONBLOCK when opening sr devices. Does
> that fix it?
>   
Yes, indeed using a patch like this:

diff --git a/extras/volume_id/vol_id.c b/extras/volume_id/vol_id.c
index 5c4e05d..3dc9f95 100644
--- a/extras/volume_id/vol_id.c
+++ b/extras/volume_id/vol_id.c
@@ -224,7 +224,7 @@ int main(int argc, char *argv[])
                goto exit;
        }
 
-       fd = open(node, O_RDONLY);
+       fd = open(node, O_RDONLY | O_NONBLOCK);
        if (fd < 0) {
                fprintf(stderr, "%s: error opening volume\n", node);
                rc = 2;

fixes the problem, too. But it looks like that this is discouraged:

http://gitweb.freedesktop.org/?p=hal.git;a=commit;h-ab6d1b27a160895e99f3a7111a78aff68baff3

;-)


Best regards,
Christian

  parent reply	other threads:[~2008-07-28  8:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-27 19:19 cd-tray immediately closed after it has been opened Christian Krause
2008-07-27 23:35 ` David Zeuthen
2008-07-28  8:48 ` Christian Krause [this message]
2008-07-28 16:23 ` David Zeuthen
2008-07-30 17:27 ` Kay Sievers
2008-07-31  7:31 ` Christian Krause
2008-07-31  7:48 ` Kay Sievers
2008-08-01 19:23 ` David Zeuthen
2008-08-03 17:38 ` Christian Krause
2008-08-04  6:52 ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=488D87C7.4090407@plauener.de \
    --to=chkr@plauener.de \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).