libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] Patch for libcdio-0.81 FreeBSD drive lock


From: John Wehle
Subject: [Libcdio-devel] Patch for libcdio-0.81 FreeBSD drive lock
Date: Thu, 23 Apr 2009 00:39:37 -0400 (EDT)

A side effect of opening the cdrom device on FreeBSD is it
locks the drive.  This makes cdio_get_media_changed less
useful and prevents you from being able to switch disks
when using things such as the audacious media player.

This patch simply unlocks the drive right after it's opened
prior to opening the cam passthrough device.

-- John Wehle
------------------8<------------------------8<------------------------
--- lib/driver/FreeBSD/freebsd_cam.c.ORIGINAL   2008-04-24 02:59:26.000000000 
-0400
+++ lib/driver/FreeBSD/freebsd_cam.c    2009-04-21 02:46:02.000000000 -0400
@@ -122,6 +122,8 @@ init_freebsd_cam (_img_private_t *p_env)
       return false;
     }
 
+  (void)ioctl(p_env->gen.fd, CDIOCALLOW);
+
   if (ioctl (p_env->gen.fd, CAMGETPASSTHRU, &p_env->ccb) < 0)
     {
       cdio_warn ("open: %s", strerror (errno));
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: address@hidden  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]