From 53fbcc89f027992e29c96086dd32eb624e181eac Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 17 Sep 2019 14:56:03 +0200 Subject: [*] Fix/simplify checks for linux --- src/server/integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/integrity.c') diff --git a/src/server/integrity.c b/src/server/integrity.c index 2058104..1fbd9dc 100644 --- a/src/server/integrity.c +++ b/src/server/integrity.c @@ -136,7 +136,7 @@ static void* integrity_main(void * data UNUSED) int i; setThreadName( "image-check" ); blockNoncriticalSignals(); -#if defined(linux) || defined(__linux) +#if defined(__linux__) // Setting nice of this thread - this is not POSIX conforming, so check if other platforms support this. // POSIX says that setpriority() should set the nice value of all threads belonging to the current process, // but on linux you can do this per thread. @@ -291,7 +291,7 @@ static void flushFileRange(dnbd3_image_t *image, uint64_t start, uint64_t end) } if ( flushFd == -1 ) return; -#if defined(linux) || defined(__linux) +#if defined(__linux__) while ( sync_file_range( flushFd, start, end - start, SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER ) == -1 ) #else while ( fsync( flushFd ) == -1 ) // TODO: fdatasync() should be available since FreeBSD 12.0 ... Might be a tad bit faster -- cgit v1.2.3-55-g7522