More generous ignoring of failure of fsync() on inappropriate fd

This commit is contained in:
Thomas Schmitt 2011-08-29 21:33:43 +00:00
parent d073709328
commit a2965e9993
2 changed files with 5 additions and 4 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2011.08.17.162201"
#define Cdrskin_timestamP "2011.08.29.213339"

View File

@ -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,