Allowed to blank appendable files and installed first back_hacks.h variable ever

This commit is contained in:
Thomas Schmitt 2006-08-26 13:49:53 +00:00
parent ad55f88859
commit 3e0b8ba42b
4 changed files with 65 additions and 1 deletions

View File

@ -11,6 +11,7 @@ libburn_libburn_la_LDFLAGS = \
libburn_libburn_la_SOURCES = \ libburn_libburn_la_SOURCES = \
libburn/async.c \ libburn/async.c \
libburn/async.h \ libburn/async.h \
libburn/back_hacks.h \
libburn/crc.c \ libburn/crc.c \
libburn/crc.h \ libburn/crc.h \
libburn/debug.c \ libburn/debug.c \

View File

@ -0,0 +1,54 @@
/**
This file bundles variables which disable changes in libburn which are
not yet completely accepted.
The use of these variables is *strongly discouraged* unless you have sincere
reason and are willing to share your gained knowledge with the libburn
developers.
Do *not silently rely* on these variables with your application. Tell us
that you needed one or more of them. They are subject to removal as soon
as consense has been found about correctness of the change they revoke.
Value 0 means that the new behavior is enabled. Any other value enables
the described old time behavior.
If you doubt one of the changes here broke your application, then do
*in your application*, *not here* :
- #include "libburn/back_hacks.h" like you include "libburn/libburn.h"
- Set the libburn_back_hack_* variable of your choice to 1.
In your app. Not here.
- Then start and use libburn as usual. Watch out for results.
- If you believe to have detected a flaw in our change, come forward
and report it to the libburn developers. Thanks in advance. :)
*/
/** Do not define this macro in your application. Only libburn/init.c is
entitled to set it.
*/
#ifdef BURN_BACK_HACKS_INIT
/** Corresponds to http://libburn.pykix.org/ticket/42
Reinstates the old ban not to blank appendable CD-RW. We see no reason
for this ban yet. It appears unusual. But maybe it patches a bug.
*/
int libburn_back_hack_42= 0;
#else /* BURN_BACK_HACKS_INIT */
/* Note: no application programmer info beyond this point */
extern int libburn_back_hack_42;
#endif /* ! BURN_BACK_HACKS_INIT */

View File

@ -18,6 +18,7 @@
#include "util.h" #include "util.h"
#include "sg.h" #include "sg.h"
#include "structure.h" #include "structure.h"
#include "back_hacks.h"
static struct burn_drive drive_array[255]; static struct burn_drive drive_array[255];
static int drivetop = -1; static int drivetop = -1;
@ -151,7 +152,10 @@ void burn_disc_erase_sync(struct burn_drive *d, int fast)
burn_print(1, "erasing drive %s %s\n", d->idata->vendor, burn_print(1, "erasing drive %s %s\n", d->idata->vendor,
d->idata->product); d->idata->product);
if (d->status != BURN_DISC_FULL) /* ts A60825 : allow on parole to blank appendable CDs */
if ( ! (d->status == BURN_DISC_FULL ||
(d->status == BURN_DISC_APPENDABLE &&
! libburn_back_hack_42) ) )
return; return;
d->cancel = 0; d->cancel = 0;
d->busy = BURN_DRIVE_ERASING; d->busy = BURN_DRIVE_ERASING;

View File

@ -10,6 +10,10 @@
#include "libburn.h" #include "libburn.h"
#include "drive.h" #include "drive.h"
/* ts A60825 : The storage location for back_hacks.h variables. */
#define BURN_BACK_HACKS_INIT 1
#include "back_hacks.h"
int burn_running = 0; int burn_running = 0;
/* ts A60813 : wether to use O_EXCL and/or O_NONBLOCK in libburn/sg.c */ /* ts A60813 : wether to use O_EXCL and/or O_NONBLOCK in libburn/sg.c */
@ -26,6 +30,7 @@ int burn_sg_open_o_nonblock = 1;
to unconditional abort of the process */ to unconditional abort of the process */
int burn_sg_open_abort_busy = 0; int burn_sg_open_abort_busy = 0;
int burn_initialize(void) int burn_initialize(void)
{ {
if (burn_running) if (burn_running)