Restoring capability of burn_random_access_write() to fsync() (lost in rev 5302)

This commit is contained in:
Thomas Schmitt 2014-04-13 12:09:34 +00:00
parent 3b187c3e5c
commit 68b2798d68
2 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2014.04.07.180808"
#define Cdrskin_timestamP "2014.04.13.120906"

View File

@ -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;
}