tdb: use fdatasync() instead of fsync() in transactions
[samba.git] / lib / tdb / common / transaction.c
index ccb4d955a329e82f6d30607d74321c2af64b1bc1..606eaa7a6fb01d2a54d5438e9b291cfcb8abeba6 100644 (file)
@@ -548,7 +548,7 @@ static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t
                return 0;
        }
 
-       if (fsync(tdb->fd) != 0) {
+       if (fdatasync(tdb->fd) != 0) {
                tdb->ecode = TDB_ERR_IO;
                TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: fsync failed\n"));
                return -1;