mmc.c: mmc_mode_sense can't use cdio_have_atapi (without further check) or else
we may get an infinite recursion. win32_ioctl.c: deal with an error message that can't be converted to a string.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: win32_ioctl.c,v 1.14 2005/02/07 04:16:19 rocky Exp $
|
||||
$Id: win32_ioctl.c,v 1.15 2005/02/11 03:30:12 rocky Exp $
|
||||
|
||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.14 2005/02/07 04:16:19 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.15 2005/02/11 03:30:12 rocky Exp $";
|
||||
|
||||
#ifdef HAVE_WIN32_CDROM
|
||||
|
||||
@@ -223,11 +223,14 @@ run_mmc_cmd_win32ioctl( void *p_user_data,
|
||||
char *psz_msg = NULL;
|
||||
long int i_err = GetLastError();
|
||||
FORMAT_ERROR(i_err, psz_msg);
|
||||
cdio_info("Error: %s", psz_msg);
|
||||
if (psz_msg)
|
||||
cdio_info("Error: %s", psz_msg);
|
||||
else
|
||||
cdio_info("Error: %ld", i_err);
|
||||
LocalFree(psz_msg);
|
||||
return 1;
|
||||
return DRIVER_OP_ERROR;
|
||||
}
|
||||
return 0;
|
||||
return DRIVER_OP_SUCCESS;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Common Multimedia Command (MMC) routines.
|
||||
|
||||
$Id: mmc.c,v 1.10 2005/02/11 01:34:12 rocky Exp $
|
||||
$Id: mmc.c,v 1.11 2005/02/11 03:30:12 rocky Exp $
|
||||
|
||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -264,15 +264,14 @@ int
|
||||
mmc_mode_sense( CdIo_t *p_cdio, /*out*/ void *p_buf, int i_size,
|
||||
int page)
|
||||
{
|
||||
bool_3way_t e_status = cdio_have_atapi(p_cdio);
|
||||
if ( yep == e_status ) {
|
||||
if ( DRIVER_OP_SUCCESS == mmc_mode_sense_6(p_cdio, p_buf, i_size, page) )
|
||||
return DRIVER_OP_SUCCESS;
|
||||
return mmc_mode_sense_10(p_cdio, p_buf, i_size, page);
|
||||
}
|
||||
if ( DRIVER_OP_SUCCESS == mmc_mode_sense_10(p_cdio, p_buf, i_size, page) )
|
||||
/* We used to make a choice as to which routine we'd use based
|
||||
cdio_have_atapi(). But since that calls this in its determination,
|
||||
we had an infinite recursion. So we can't use cdio_have_atapi()
|
||||
(until we put in better capability checks.)
|
||||
*/
|
||||
if ( DRIVER_OP_SUCCESS == mmc_mode_sense_6(p_cdio, p_buf, i_size, page) )
|
||||
return DRIVER_OP_SUCCESS;
|
||||
return mmc_mode_sense_6(p_cdio, p_buf, i_size, page);
|
||||
return mmc_mode_sense_10(p_cdio, p_buf, i_size, page);
|
||||
}
|
||||
|
||||
/*! Run a MODE_SENSE command (6-byte version)
|
||||
|
||||
Reference in New Issue
Block a user