Made burn_drive_scan() refuse work on non-empty drive list.

This commit is contained in:
Thomas Schmitt 2007-09-07 15:50:31 +00:00
parent bf167c9451
commit 624e05055c
5 changed files with 12 additions and 6 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.09.07.123748"
#define Cdrskin_timestamP "2007.09.07.154951"

View File

@ -175,7 +175,8 @@ drive_is_active:;
/* ts A61007 : test moved up from burn_drive_scan_sync()
was burn_wait_all() */
if (!burn_drives_are_clear())
/* ts A70907 : now demanding freed drives, not only released */
if (!burn_drives_are_clear(1))
goto drive_is_active;
*drives = NULL;
*n_drives = 0;

View File

@ -445,7 +445,8 @@ void burn_drive_release(struct burn_drive *d, int le)
/* ts A61007 : former void burn_wait_all() */
int burn_drives_are_clear(void)
/* @param flag bit0= demand freed drives (else released drives) */
int burn_drives_are_clear(int flag)
{
int i;
@ -453,7 +454,7 @@ int burn_drives_are_clear(void)
/* ts A60904 : ticket 62, contribution by elmom */
if (drive_array[i].global_index == -1)
continue;
if (drive_array[i].released)
if (drive_array[i].released && !(flag & 1))
continue;
return 0;
}
@ -798,6 +799,9 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[],
state */
#endif /* 0 */
/* ts A70907 : moved here from burn_drive_info_free() */
burn_drive_free_all();
/* refresh the lib's drives */
/* ts A61115 : formerly sg_enumerate(); ata_enumerate(); */

View File

@ -43,7 +43,8 @@ unsigned int burn_drive_count(void);
/* ts A61007 */
/* void burn_wait_all(void); */
int burn_drives_are_clear(void);
/* @param flag bit0= demand freed drives (else released drives) */
int burn_drives_are_clear(int flag);
int burn_sector_length_write(struct burn_drive *d);
int burn_track_control(struct burn_drive *d, int);

View File

@ -107,7 +107,7 @@ void burn_finish(void)
/* ts A61007 */
/* burn_wait_all(); */
if (!burn_drives_are_clear()) {
if (!burn_drives_are_clear(0)) {
libdax_msgs_submit(libdax_messenger, -1, 0x00020107,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
"Drive is busy on attempt to shut down library", 0, 0);