Detect disc-image and don't open this device driver for that.

This commit is contained in:
rocky
2004-05-06 01:37:43 +00:00
parent 697cbc32d2
commit a5a298e495

View File

@@ -1,5 +1,5 @@
/*
$Id: _cdio_bsdi.c,v 1.22 2004/04/30 06:54:15 rocky Exp $
$Id: _cdio_bsdi.c,v 1.23 2004/05/06 01:37:43 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.22 2004/04/30 06:54:15 rocky Exp $";
static const char _rcsid[] = "$Id: _cdio_bsdi.c,v 1.23 2004/05/06 01:37:43 rocky Exp $";
#include <cdio/sector.h>
#include <cdio/util.h>
@@ -705,12 +705,13 @@ cdio_open_am_bsdi (const char *psz_source_name, const char *psz_access_mode)
ones to set that up.
*/
CdIo *
cdio_open_bsdi (const char *source_name)
cdio_open_bsdi (const char *psz_orig_source)
{
#ifdef HAVE_BSDI_CDROM
CdIo *ret;
_img_private_t *_data;
char *psz_source;
cdio_funcs _funcs = {
.eject_media = _eject_media_bsdi,
@@ -742,8 +743,22 @@ cdio_open_bsdi (const char *source_name)
_data->gen.init = false;
_data->gen.fd = -1;
_set_arg_bsdi(_data, "source", (NULL == source_name)
? DEFAULT_CDIO_DEVICE: source_name);
if (NULL == psz_orig_source) {
psz_source=cdio_get_default_device_linux();
if (NULL == psz_source) return NULL;
_set_arg_bsdi(_data, "source", psz_source);
free(psz_source);
} else {
if (cdio_is_device_generic(psz_orig_source))
_set_arg_bsdi(_data, "source", psz_orig_source);
else {
/* The below would be okay if all device drivers worked this way. */
#if 0
cdio_info ("source %s is a not a device", psz_orig_source);
#endif
return NULL;
}
}
ret = cdio_new (_data, &_funcs);
if (ret == NULL) return NULL;