Moved blanking suitability test before eventual spwaning of threads

This commit is contained in:
Thomas Schmitt 2007-01-03 16:49:09 +00:00
parent a4f7906b16
commit d5e18ee42a
3 changed files with 21 additions and 10 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.01.03.163026"
#define Cdrskin_timestamP "2007.01.03.164716"

View File

@ -7,9 +7,11 @@
#include "options.h"
#include "async.h"
#include "init.h"
#include "back_hacks.h"
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
/*
#include <a ssert.h>
@ -207,6 +209,9 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
{
struct erase_opts o;
/* A70103 : will be set to 0 by burn_disc_erase_sync() */
drive->cancel = 1;
/* ts A61006 */
/* a ssert(drive); */
/* a ssert(!SCAN_GOING()); */
@ -227,6 +232,19 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
return;
}
/* ts A70103 moved up from burn_disc_erase_sync() */
/* ts A60825 : allow on parole to blank appendable CDs */
if ( ! (drive->status == BURN_DISC_FULL ||
(drive->status == BURN_DISC_APPENDABLE &&
! libburn_back_hack_42) ) ) {
libdax_msgs_submit(libdax_messenger, drive->global_index,
0x00020130,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
"Drive and media state unsuitable for blanking",
0, 0);
return;
}
o.drive = drive;
o.fast = fast;
add_worker(drive, (WorkerFunc) erase_worker_func, &o);

View File

@ -25,7 +25,6 @@
#include "util.h"
#include "sg.h"
#include "structure.h"
#include "back_hacks.h"
#include "libdax_msgs.h"
extern struct libdax_msgs *libdax_messenger;
@ -444,13 +443,6 @@ void burn_disc_erase_sync(struct burn_drive *d, int fast)
burn_print(1, "erasing drive %s %s\n", d->idata->vendor,
d->idata->product);
/* ts A60825 : allow on parole to blank appendable CDs */
if ( ! (d->status == BURN_DISC_FULL ||
(d->status == BURN_DISC_APPENDABLE &&
! libburn_back_hack_42) ) ) {
d->cancel = 1;
return;
}
d->cancel = 0;
d->busy = BURN_DRIVE_ERASING;
d->erase(d, fast);
@ -468,7 +460,7 @@ void burn_disc_erase_sync(struct burn_drive *d, int fast)
while (!d->test_unit_ready(d) && d->get_erase_progress(d) == 0)
sleep(1);
while ((d->progress.sector = d->get_erase_progress(d)) > 0 ||
!d->test_unit_ready(d))
!d->test_unit_ready(d))
sleep(1);
d->progress.sector = 0x10000;
@ -503,6 +495,7 @@ void burn_disc_format_sync(struct burn_drive *d, int flag)
while ((d->progress.sector = d->get_erase_progress(d)) > 0 ||
!d->test_unit_ready(d))
sleep(1);
d->sync_cache(d);
d->progress.sector = 0x10000;