Prevented SIGSEGV after illegal drive operations during sync write

This commit is contained in:
Thomas Schmitt 2008-10-04 07:27:43 +00:00
parent 9fc52dc0ef
commit 5e0f0e0681
4 changed files with 9 additions and 8 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2008.09.28.211741"
#define Cdrskin_timestamP "2008.10.04.072657"

View File

@ -624,7 +624,7 @@ void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag)
int ret, buf_secs, err, i, stages = 1, pbase, pfill, pseudo_sector;
off_t num_bufs;
char msg[80];
struct buffer buf;
struct buffer buf, *buf_mem = d->buffer;
/* reset the progress */
d->progress.session = 0;
@ -706,7 +706,7 @@ void burn_disc_format_sync(struct burn_drive *d, off_t size, int flag)
ex:;
d->progress.sector = 0x10000;
d->busy = BURN_DRIVE_IDLE;
d->buffer = NULL;
d->buffer = buf_mem;
}

View File

@ -323,7 +323,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
int alignment = 2048, start, upto, chunksize = 1, err, cpy_size, i;
int sose_mem = 0, fd = -1, ret;
char msg[81], *wpt;
struct buffer buf;
struct buffer buf, *buffer_mem = d->buffer;
/*
#define Libburn_read_data_adr_logginG 1
@ -485,7 +485,7 @@ ex:;
if (fd != -1)
close(fd);
*/
d->buffer = NULL;
d->buffer = buffer_mem;
d->busy = BURN_DRIVE_IDLE;
return ret;
}

View File

@ -1996,7 +1996,7 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
{
struct cue_sheet *sheet;
struct burn_drive *d = o->drive;
struct buffer buf;
struct buffer buf, *buffer_mem = o->drive->buffer;
struct burn_track *lt, *t;
int first = 1, i, ret, lba, nwa = 0;
off_t default_size;
@ -2206,6 +2206,7 @@ fail_wo_sync:;
d->busy = BURN_DRIVE_IDLE;
ex:;
d->do_stream_recording = 0;
d->buffer = buffer_mem;
return;
}
@ -2215,7 +2216,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
{
int alignment = 0, start, upto, chunksize, err, fd = -1, ret;
char msg[81], *rpt;
struct buffer buf;
struct buffer buf, *buffer_mem = d->buffer;
if (d->released) {
libdax_msgs_submit(libdax_messenger,
@ -2326,7 +2327,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
if(fd >= 0)
close(fd);
d->buffer = NULL;
d->buffer = buffer_mem;
d->busy = BURN_DRIVE_IDLE;
return 1;
}