diff options
Diffstat (limited to 'src/server/uplink.c')
-rw-r--r-- | src/server/uplink.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/server/uplink.c b/src/server/uplink.c index 538f388..26e5d4e 100644 --- a/src/server/uplink.c +++ b/src/server/uplink.c @@ -14,12 +14,6 @@ #include <poll.h> #include <unistd.h> -#ifdef HAVE_FDATASYNC -#define dnbd3_fdatasync fdatasync -#else -#define dnbd3_fdatasync fsync -#endif - static uint64_t totalBytesReceived = 0; static pthread_spinlock_t statisticsReceivedLock; @@ -851,7 +845,7 @@ static bool uplink_saveCacheMap(dnbd3_connection_t *link) assert( image != NULL ); if ( link->cacheFd != -1 ) { - if ( dnbd3_fdatasync( link->cacheFd ) == -1 ) { + if ( fsync( link->cacheFd ) == -1 ) { // A failing fsync means we have no guarantee that any data // since the last fsync (or open if none) has been saved. Apart // from keeping the cache_map from the last successful fsync @@ -905,7 +899,7 @@ static bool uplink_saveCacheMap(dnbd3_connection_t *link) } done += (size_t)ret; } - if ( dnbd3_fdatasync( fd ) == -1 ) { + if ( fsync( fd ) == -1 ) { logadd( LOG_WARNING, "fsync() on image map %s failed with errno %d", mapfile, errno ); } close( fd ); |