From 3b8f7c7007102c06ddb00753f61a14a95f2e9456 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 29 Aug 2011 21:33:43 +0000 Subject: [PATCH] More generous ignoring of failure of fsync() on inappropriate fd --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/write.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 7b62cb7b..2754e57d 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.08.17.162201" +#define Cdrskin_timestamP "2011.08.29.213339" diff --git a/libburn/trunk/libburn/write.c b/libburn/trunk/libburn/write.c index e04403ba..bbcc2762 100644 --- a/libburn/trunk/libburn/write.c +++ b/libburn/trunk/libburn/write.c @@ -2184,6 +2184,8 @@ int burn_stdio_mmc_dummy_write(struct burn_drive *d, int start, */ int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag) { + int ret; + if (fd < 0) { libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002017d, @@ -2198,9 +2200,8 @@ int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag) libdax_msgs_submit(libdax_messenger, -1, 0x00000002, LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, "syncing cache (stdio fsync)", 0, 0); - if (fsync(fd) != 0) { - if (errno == EINVAL) /* E.g. /dev/null cannot fsync */ - return 1; + ret = fsync(fd); + if (ret != 0 && errno == EIO) { libdax_msgs_submit(libdax_messenger, d->global_index, 0x00020148, LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,