Call fsync AFTER checking return code from previous call.

master
Christopher J. Morrone 2011-11-21 19:54:02 -08:00
parent 126374230a
commit f2c7aed220
1 changed files with 2 additions and 2 deletions

View File

@ -229,10 +229,10 @@ static IOR_offset_t POSIX_Xfer(int access, void *file, IOR_size_t * buffer,
param->offset + length - remaining);
}
rc = write(fd, ptr, remaining);
if (param->fsyncPerWrite == TRUE)
POSIX_Fsync(&fd, param);
if (rc == -1)
ERR("write() failed");
if (param->fsyncPerWrite == TRUE)
POSIX_Fsync(&fd, param);
} else { /* READ or CHECK */
if (verbose >= VERBOSE_4) {
fprintf(stdout,