From 13245c6a5594d2e75abb4a11495ce8420aea1dba Mon Sep 17 00:00:00 2001 From: rocky Date: Thu, 23 Apr 2009 03:26:00 -0400 Subject: [PATCH] Patch from John Wehle: 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. --- lib/driver/FreeBSD/freebsd_cam.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/driver/FreeBSD/freebsd_cam.c b/lib/driver/FreeBSD/freebsd_cam.c index 23fb3954..2e032ea4 100644 --- a/lib/driver/FreeBSD/freebsd_cam.c +++ b/lib/driver/FreeBSD/freebsd_cam.c @@ -1,7 +1,7 @@ /* $Id: freebsd_cam.c,v 1.12 2008/04/21 18:30:20 karl Exp $ - Copyright (C) 2004, 2005, 2008 Rocky Bernstein + Copyright (C) 2004, 2005, 2008, 2009 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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));