Moved blanking suitability test before eventual spwaning of threads

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

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);