summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-09-17 14:56:03 +0200
committerSimon Rettberg2019-09-17 14:56:03 +0200
commit53fbcc89f027992e29c96086dd32eb624e181eac (patch)
tree171be9e25c0dafabb9fcb4e9c6c8c653ed04f08f
parent[SERVER] rpc: Fix warnings (diff)
downloaddnbd3-53fbcc89f027992e29c96086dd32eb624e181eac.tar.gz
dnbd3-53fbcc89f027992e29c96086dd32eb624e181eac.tar.xz
dnbd3-53fbcc89f027992e29c96086dd32eb624e181eac.zip
[*] Fix/simplify checks for linux
-rw-r--r--src/server/integrity.c4
-rw-r--r--src/shared/fdsignal.c2
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