From 511d23f5745dae994796d87c0d9f431cd014189d Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 13 Apr 2014 12:09:34 +0000 Subject: [PATCH] Restoring capability of burn_random_access_write() to fsync() (lost in rev 5302) --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/write.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 8942be3..906360a 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2014.04.07.180808" +#define Cdrskin_timestamP "2014.04.13.120906" diff --git a/libburn/write.c b/libburn/write.c index 4095dfa..5743ffd 100644 --- a/libburn/write.c +++ b/libburn/write.c @@ -2662,6 +2662,7 @@ int burn_stdio_mmc_dummy_write(struct burn_drive *d, int start, /* ts A70911 */ /* Flush stdio system buffer to physical device. @param flag bit0= do not report debug message (intermediate sync) + bit1= do fsync(2) unconditionally */ int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag) { @@ -2679,7 +2680,9 @@ int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag) } d->needs_sync_cache = 0; do_fsync = 0; - if (d->write_opts != NULL) + if (flag & 2) + do_fsync = 1; + else if (d->write_opts != NULL) do_fsync = (d->write_opts->stdio_fsync_size >= 0); if (do_fsync) { if (!(flag & 1)) @@ -3290,7 +3293,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address, if(d->drive_role == 1) d->sync_cache(d); else - burn_stdio_sync_cache(fd, d, 0); + burn_stdio_sync_cache(fd, d, 2); d->needs_sync_cache = 0; }