Remove some Unixisms in checking drive. Rely on libcdio to do the

checking - it's platform independent.

win32_ioctl.c: more detailed info message.
This commit is contained in:
rocky
2005-01-06 16:37:30 +00:00
parent 967e08d00d
commit 9771c44e95
2 changed files with 6 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: scan_devices.c,v 1.4 2005/01/06 03:38:58 rocky Exp $ $Id: scan_devices.c,v 1.5 2005/01/06 16:37:30 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -122,23 +122,9 @@ cdda_find_a_cdrom(int messagedest, char **messages){
cdrom_drive_t * cdrom_drive_t *
cdda_identify(const char *device, int messagedest,char **messages) cdda_identify(const char *device, int messagedest,char **messages)
{ {
struct stat st;
cdrom_drive_t *d=NULL; cdrom_drive_t *d=NULL;
idmessage(messagedest,messages,"Checking %s for cdrom...",device); idmessage(messagedest,messages,"Checking %s for cdrom...",device);
if(stat(device,&st)){
idperror(messagedest,messages,"\tCould not stat %s",device);
return(NULL);
}
#ifndef CDDA_TEST
if (!S_ISCHR(st.st_mode) &&
!S_ISBLK(st.st_mode)){
idmessage(messagedest,messages,"\t%s is not a block or character device",device);
return(NULL);
}
#endif
d=cdda_identify_cooked(device,messagedest,messages); d=cdda_identify_cooked(device,messagedest,messages);
#ifdef CDDA_TEST #ifdef CDDA_TEST
@@ -174,7 +160,7 @@ cdda_identify_cooked(const char *dev, int messagedest, char **messages)
CdIo_t *p_cdio = NULL; CdIo_t *p_cdio = NULL;
device = test_resolve_symlink(dev,messagedest,messages); device = test_resolve_symlink(dev,messagedest,messages);
if ( !device ) return NULL; if ( !device ) device = strdup(dev);
p_cdio = cdio_open(device, DRIVER_UNKNOWN); p_cdio = cdio_open(device, DRIVER_UNKNOWN);

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32_ioctl.c,v 1.3 2005/01/01 15:08:48 rocky Exp $ $Id: win32_ioctl.c,v 1.4 2005/01/06 16:37:31 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.3 2005/01/01 15:08:48 rocky Exp $"; static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.4 2005/01/06 16:37:31 rocky Exp $";
#ifdef HAVE_WIN32_CDROM #ifdef HAVE_WIN32_CDROM
@@ -380,8 +380,8 @@ read_audio_sectors_win32ioctl (_img_private_t *env, void *data, lsn_t lsn,
char *psz_msg = NULL; char *psz_msg = NULL;
long int i_err = GetLastError(); long int i_err = GetLastError();
FORMAT_ERROR(i_err, psz_msg); FORMAT_ERROR(i_err, psz_msg);
cdio_info("Error reading audio-mode %lu\n%s)", cdio_info("Error reading audio-mode lsn %lu\n%s (%d))",
(long unsigned int) lsn, psz_msg); (long unsigned int) lsn, psz_msg, i_err);
LocalFree(psz_msg); LocalFree(psz_msg);
return 1; return 1;
} }