From f23deebe802c95fa6099831bea4984dec28b853d Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 3 Jan 2007 16:49:09 +0000 Subject: [PATCH] Moved blanking suitability test before eventual spwaning of threads --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/async.c | 18 ++++++++++++++++++ libburn/drive.c | 11 ++--------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index e128ca5..33cb93d 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.01.03.163026" +#define Cdrskin_timestamP "2007.01.03.164716" diff --git a/libburn/async.c b/libburn/async.c index 4aae06e..73dd204 100644 --- a/libburn/async.c +++ b/libburn/async.c @@ -7,9 +7,11 @@ #include "options.h" #include "async.h" #include "init.h" +#include "back_hacks.h" #include #include +#include /* #include @@ -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); diff --git a/libburn/drive.c b/libburn/drive.c index 700fba2..5ab9436 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -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;