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 ++-- src/shared/fdsignal.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 diff --git a/src/shared/fdsignal.c b/src/shared/fdsignal.c index 5e5cf7f..087b6f1 100644 --- a/src/shared/fdsignal.c +++ b/src/shared/fdsignal.c @@ -1,6 +1,6 @@ #include "fdsignal.h" -#if defined(linux) || defined(__linux) || defined(__linux__) +#if defined(__linux__) //#warning "Using eventfd based signalling" #include "fdsignal.inc/eventfd.c" #elif __SIZEOF_INT__ == 4 && __SIZEOF_POINTER__ == 8 -- cgit v1.2.3-55-g7522