Possibly Solaris close tray fixes.

This commit is contained in:
rocky
2005-03-08 04:10:36 +00:00
parent 2e91ef8ab5
commit 2b53fd1f60
4 changed files with 37 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cdio_private.h,v 1.24 2005/03/08 03:11:19 rocky Exp $ $Id: cdio_private.h,v 1.25 2005/03/08 04:10:36 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -474,6 +474,7 @@ extern "C" {
unsigned int *i_drives); unsigned int *i_drives);
driver_return_code_t close_tray_linux (const char *psz_device); driver_return_code_t close_tray_linux (const char *psz_device);
driver_return_code_t close_tray_solaris(const char *psz_device);
driver_return_code_t close_tray_win32 (const char *psz_win32_drive); driver_return_code_t close_tray_win32 (const char *psz_win32_drive);

View File

@@ -1,5 +1,5 @@
/* /*
$Id: device.c,v 1.16 2005/03/08 03:11:19 rocky Exp $ $Id: device.c,v 1.17 2005/03/08 04:10:36 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -173,7 +173,7 @@ CdIo_driver_t CdIo_all_drivers[CDIO_MAX_DRIVER+1] = {
&cdio_get_default_device_osx, &cdio_get_default_device_osx,
&cdio_is_device_generic, &cdio_is_device_generic,
&cdio_get_devices_osx, &cdio_get_devices_osx,
NULL &close_tray_solaris
}, },
{DRIVER_WIN32, {DRIVER_WIN32,

View File

@@ -1,5 +1,5 @@
/* /*
$Id: gnu_linux.c,v 1.7 2005/03/07 07:23:52 rocky Exp $ $Id: gnu_linux.c,v 1.8 2005/03/08 04:10:36 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: gnu_linux.c,v 1.7 2005/03/07 07:23:52 rocky Exp $"; static const char _rcsid[] = "$Id: gnu_linux.c,v 1.8 2005/03/08 04:10:36 rocky Exp $";
#include <string.h> #include <string.h>
@@ -1307,7 +1307,7 @@ cdio_get_default_device_linux(void)
/*! /*!
Close tray on CD-ROM. Close tray on CD-ROM.
@param p_user_data the CD object to be acted upon. @param psz_device the CD-ROM drive to be closed.
*/ */
driver_return_code_t driver_return_code_t

View File

@@ -1,5 +1,5 @@
/* /*
$Id: solaris.c,v 1.6 2005/03/06 23:11:47 rocky Exp $ $Id: solaris.c,v 1.7 2005/03/08 04:10:36 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -38,7 +38,7 @@
#ifdef HAVE_SOLARIS_CDROM #ifdef HAVE_SOLARIS_CDROM
static const char _rcsid[] = "$Id: solaris.c,v 1.6 2005/03/06 23:11:47 rocky Exp $"; static const char _rcsid[] = "$Id: solaris.c,v 1.7 2005/03/08 04:10:36 rocky Exp $";
#ifdef HAVE_GLOB_H #ifdef HAVE_GLOB_H
#include <glob.h> #include <glob.h>
@@ -225,19 +225,6 @@ audio_stop_solaris (void *p_user_data)
return ioctl(p_env->gen.fd, CDROMSTOP); return ioctl(p_env->gen.fd, CDROMSTOP);
} }
/*!
Close tray on CD-ROM.
@param p_user_data the CD object to be acted upon.
*/
static driver_return_code_t
close_tray_solaris (void *p_user_data)
{
const _img_private_t *p_env = p_user_data;
return ioctl(p_env->gen.fd, CDROMSTART);
}
/*! /*!
Initialize CD device. Initialize CD device.
*/ */
@@ -949,6 +936,34 @@ cdio_get_default_device_solaris(void)
#endif /* HAVE_SOLARIS_CDROM */ #endif /* HAVE_SOLARIS_CDROM */
/*!
Close tray on CD-ROM.
@param psz_device the CD-ROM drive to be closed.
*/
driver_return_code_t
close_tray_solaris (const char *psz_device)
{
#ifdef HAVE_SOLARIS_CDROM
int i_rc;
int fd = open (psz_device, O_RDONLY|O_NONBLOCK);
if ( fd > -1 ) {
i_rc = DRIVER_OP_SUCCESS;
if((i_rc = ioctl(fd, CDROMSTART)) != 0) {
cdio_warn ("ioctl CDROMSTART failed: %s\n", strerror(errno));
i_rc = DRIVER_OP_ERROR;
}
close(fd);
} else
i_rc = DRIVER_OP_ERROR;
return i_rc;
#else
return DRIVER_OP_NO_DRIVER;
#endif /*HAVE_SOLARIS_CDROM*/
}
/*! /*!
Return an array of strings giving possible CD devices. Return an array of strings giving possible CD devices.
*/ */
@@ -1034,7 +1049,6 @@ cdio_open_am_solaris (const char *psz_orig_source, const char *access_mode)
_funcs.audio_set_volume = audio_set_volume_solaris; _funcs.audio_set_volume = audio_set_volume_solaris;
_funcs.audio_stop = audio_stop_solaris, _funcs.audio_stop = audio_stop_solaris,
_funcs.eject_media = eject_media_solaris; _funcs.eject_media = eject_media_solaris;
_funcs.close_tray = close_tray_solaris;
_funcs.free = cdio_generic_free; _funcs.free = cdio_generic_free;
_funcs.get_arg = get_arg_solaris; _funcs.get_arg = get_arg_solaris;
#if USE_MMC #if USE_MMC