"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libburn/write.c" between
xorriso-1.4.6.tar.gz and xorriso-1.4.8.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

write.c  (xorriso-1.4.6):write.c  (xorriso-1.4.8)
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2016 Thomas Schmitt <scdbackup@gmx.net> Copyright (c) 2006 - 2017 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
#endif #endif
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
skipping to change at page 5, line ? skipping to change at page 5, line ?
return 0; return 0;
} }
/* ts A70219 : API */ /* ts A70219 : API */
int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc, int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
char reasons[BURN_REASONS_LEN], int silent) char reasons[BURN_REASONS_LEN], int silent)
{ {
enum burn_write_types wt; enum burn_write_types wt;
struct burn_drive *d = o->drive; struct burn_drive *d = o->drive;
char *msg = NULL, *reason_pt; char *msg = NULL, *reason_pt;
int no_media = 0, ret, has_cdtext; int no_media = 0, ret, has_cdtext, is_bd_pow = 0;
reason_pt= reasons; reason_pt= reasons;
reasons[0] = 0; reasons[0] = 0;
if (d->drive_role == 0 || d->drive_role == 4) { if (d->drive_role == 0 || d->drive_role == 4) {
if (d->drive_role == 0) if (d->drive_role == 0)
sprintf(reasons, sprintf(reasons,
"DRIVE: is a virtual placeholder (null-drive)"); "DRIVE: is a virtual placeholder (null-drive)");
else else
sprintf(reasons, "DRIVE: read-only pseudo drive"); sprintf(reasons, "DRIVE: read-only pseudo drive");
skipping to change at page 5, line ? skipping to change at page 5, line ?
"write start address not properly aligned to 32k, "); "write start address not properly aligned to 32k, ");
} else if (d->drive_role == 3 || } else if (d->drive_role == 3 ||
d->current_profile == 0x11 || d->current_profile == 0x14 || d->current_profile == 0x11 || d->current_profile == 0x14 ||
d->current_profile == 0x15 || d->current_profile == 0x15 ||
d->current_profile == 0x1b || d->current_profile == 0x2b || d->current_profile == 0x1b || d->current_profile == 0x2b ||
d->current_profile == 0x41) { d->current_profile == 0x41) {
/* DVD-R* Sequential , DVD+R[/DL] , BD-R, /* DVD-R* Sequential , DVD+R[/DL] , BD-R,
sequential stdio "drive" */ sequential stdio "drive" */
if (o->start_byte >= 0) if (o->start_byte >= 0)
strcat(reasons, "write start address not supported, "); strcat(reasons, "write start address not supported, ");
is_bd_pow = burn_drive_get_bd_r_pow(d);
if (is_bd_pow && !silent)
libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002011e,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
"Unsuitable media detected: BD-R formatted to POW.",
0, 0);
if (is_bd_pow) {
strcat(reasons,
"unsuitable media formatting POW detected, ");
return 0;
}
} else { } else {
unsuitable_profile:; unsuitable_profile:;
msg = calloc(1, 160); msg = calloc(1, 160);
if (msg != NULL && !silent) { if (msg != NULL && !silent) {
sprintf(msg, sprintf(msg,
"Unsuitable media detected. Profile %4.4Xh %s", "Unsuitable media detected. Profile %4.4Xh %s",
d->current_profile, d->current_profile_text); d->current_profile, d->current_profile_text);
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002011e, 0x0002011e,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
skipping to change at line 2541 skipping to change at line 2555
/* ts A70904 */ /* ts A70904 */
int burn_stdio_write(int fd, char *buf, int count, struct burn_drive *d, int burn_stdio_write(int fd, char *buf, int count, struct burn_drive *d,
int flag) int flag)
{ {
int ret = 0; int ret = 0;
char *msg = NULL; char *msg = NULL;
int todo, done, retries; int todo, done, retries;
if (d->cancel || count <= 0) if (d->cancel || count <= 0)
return 0; return 0;
if(d->do_simulate)
return 1;
todo = count; todo = count;
done = 0; done = 0;
for (retries = 0; todo > 0 && retries <= Libburn_stdio_write_retrieS; for (retries = 0; todo > 0 && retries <= Libburn_stdio_write_retrieS;
retries++) { retries++) {
/* /*
fprintf(stderr, "libburn_DEBUG: write(%d, %lX, %d)\n", fprintf(stderr, "libburn_DEBUG: write(%d, %lX, %d)\n",
fd, (unsigned long) buf, count); fd, (unsigned long) buf, count);
*/ */
ret = write(fd, buf + done, todo); ret = write(fd, buf + done, todo);
skipping to change at line 2571 skipping to change at line 2587
sprintf(msg + strlen(msg), " Did %d retries. Last", sprintf(msg + strlen(msg), " Did %d retries. Last",
retries - 1); retries - 1);
sprintf(msg + strlen(msg), " write(2) returned %d.", ret); sprintf(msg + strlen(msg), " write(2) returned %d.", ret);
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020148, 0x00020148,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
msg, errno, 0); msg, errno, 0);
d->cancel = 1; d->cancel = 1;
ret = 0; goto ex; ret = 0; goto ex;
} }
ret = 1;
ex:; ex:;
BURN_FREE_MEM(msg); BURN_FREE_MEM(msg);
return ret; return ret;
} }
/* ts A70910 : to be used as burn_drive.write(), emulating mmc_write() */ /* ts A70910 : to be used as burn_drive.write(), emulating mmc_write() */
int burn_stdio_mmc_write(struct burn_drive *d, int start, struct buffer *buf) int burn_stdio_mmc_write(struct burn_drive *d, int start, struct buffer *buf)
{ {
int ret; int ret;
off_t start_byte; off_t start_byte;
skipping to change at line 2740 skipping to change at line 2757
burn_disc_init_track_status(o, s, t, tnum, sectors); burn_disc_init_track_status(o, s, t, tnum, sectors);
open_ended = burn_track_is_open_ended(t); open_ended = burn_track_is_open_ended(t);
t->end_on_premature_eoi = (o->write_type == BURN_WRITE_TAO); t->end_on_premature_eoi = (o->write_type == BURN_WRITE_TAO);
/* attach stdio emulators for mmc_*() functions */ /* attach stdio emulators for mmc_*() functions */
if (o->simulate) if (o->simulate)
d->write = burn_stdio_mmc_dummy_write; d->write = burn_stdio_mmc_dummy_write;
else else
d->write = burn_stdio_mmc_write; d->write = burn_stdio_mmc_write;
d->do_simulate = o->simulate;
d->sync_cache = burn_stdio_mmc_sync_cache; d->sync_cache = burn_stdio_mmc_sync_cache;
burn_stdio_slowdown(d, &prev_time, 0, 1); /* initialize */ burn_stdio_slowdown(d, &prev_time, 0, 1); /* initialize */
for (i = 0; open_ended || i < sectors; i++) { for (i = 0; open_ended || i < sectors; i++) {
/* transact a (CD sized) sector */ /* transact a (CD sized) sector */
if (!sector_data(o, t, 0)) if (!sector_data(o, t, 0))
{ret= 0; goto ex;} {ret= 0; goto ex;}
if (open_ended) if (open_ended)
d->progress.sectors = sectors = d->progress.sector; d->progress.sectors = sectors = d->progress.sector;
if (open_ended || t->end_on_premature_eoi) { if (open_ended || t->end_on_premature_eoi) {
skipping to change at line 3231 skipping to change at line 3249
rpt = data; rpt = data;
for (; start < upto; start += 16) { for (; start < upto; start += 16) {
chunksize = upto - start; chunksize = upto - start;
if (chunksize > 16) if (chunksize > 16)
chunksize = 16; chunksize = 16;
d->buffer->bytes = chunksize * 2048; d->buffer->bytes = chunksize * 2048;
memcpy(d->buffer->data, rpt, d->buffer->bytes); memcpy(d->buffer->data, rpt, d->buffer->bytes);
rpt += d->buffer->bytes; rpt += d->buffer->bytes;
d->buffer->sectors = chunksize; d->buffer->sectors = chunksize;
d->nwa = start; d->nwa = start;
if(d->drive_role == 1) { if(d->do_simulate) {
err = 0;
} else if(d->drive_role == 1) {
err = d->write(d, d->nwa, d->buffer); err = d->write(d, d->nwa, d->buffer);
} else { } else {
ret = burn_stdio_write(fd, (char *) d->buffer->data, ret = burn_stdio_write(fd, (char *) d->buffer->data,
d->buffer->bytes, d, 0); d->buffer->bytes, d, 0);
err = 0; err = 0;
if (ret <= 0) if (ret <= 0)
err = BE_CANCELLED; err = BE_CANCELLED;
} }
if (err == BE_CANCELLED) { if (err == BE_CANCELLED) {
d->busy = BURN_DRIVE_IDLE; d->busy = BURN_DRIVE_IDLE;
if(fd >= 0 && do_close) if(fd >= 0 && do_close)
close(fd); close(fd);
{ret = -(start * 2048 - byte_address); goto ex;} {ret = -(start * 2048 - byte_address); goto ex;}
} }
} }
if(d->drive_role == 1) if(d->drive_role == 1)
d->needs_sync_cache = 1; d->needs_sync_cache = 1;
if(flag & 1) { if(flag & 1) {
if(d->drive_role == 1) if(d->do_simulate) {
;
} else if(d->drive_role == 1)
d->sync_cache(d); d->sync_cache(d);
else else
burn_stdio_sync_cache(fd, d, 2); burn_stdio_sync_cache(fd, d, 2);
d->needs_sync_cache = 0; d->needs_sync_cache = 0;
} }
if(fd >= 0 && do_close) if(fd >= 0 && do_close)
close(fd); close(fd);
d->buffer = buffer_mem; d->buffer = buffer_mem;
d->busy = BURN_DRIVE_IDLE; d->busy = BURN_DRIVE_IDLE;
 End of changes. 8 change blocks. 
4 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)