From 3013dd0856a955999044071c5f9b78aa19d37816 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 2 Jun 2009 17:21:43 +0000 Subject: [PATCH] Avoided to enumerate faulty drive objects --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/drive.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 2360dab8..6011c83b 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2009.06.02.162841" +#define Cdrskin_timestamP "2009.06.02.172201" diff --git a/libburn/trunk/libburn/drive.c b/libburn/trunk/libburn/drive.c index 0019ebfa..87f91e3a 100644 --- a/libburn/trunk/libburn/drive.c +++ b/libburn/trunk/libburn/drive.c @@ -930,7 +930,7 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[], */ unsigned char scanned[32]; unsigned count = 0; - int i; + int i, ret; /* ts A61007 : moved up to burn_drive_scan() */ /* a ssert(burn_running); */ @@ -994,11 +994,15 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[], } */ /* ts A90602 : A single call shall do (rather than a loop) */ - drive_getcaps(&drive_array[i], &(*drives)[*n_drives]); - - (*n_drives)++; + ret = drive_getcaps(&drive_array[i], &(*drives)[*n_drives]); + if (ret > 0) + (*n_drives)++; scanned[i / 8] |= 1 << (i % 8); } + if (*drives != NULL && *n_drives == 0) { + free ((char *) *drives); + *drives = NULL; + } return(1); }