From 8ae413235d4b3f68f0858a3ce2cd65291f9cbe64 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Sun, 11 Mar 2018 20:19:26 +0100 Subject: Remove redundant checks for MSG_* from configure.ac It is redundant to check for the presence of MSG_NOSIGNAL macro in configure.ac, define HAVE_MSG_NOSIGNAL and then check whether the later is defined in the source code. Instead we can check directly whether MSG_NOSIGNAL is defined. Same for MSG_DONTWAIT. In addition to that, the checks we had in configure.ac produce a compiler warning about unused variable and thus could fail if -Werror is present and erroneously proclaim that the macros are not available. --- src/net.cpp | 5 +++-- src/netbase.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net.cpp b/src/net.cpp index 53a0a9b180..4849e067aa 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -42,12 +42,13 @@ // We add a random period time (0 to 1 seconds) to feeler connections to prevent synchronization. #define FEELER_SLEEP_WINDOW 1 -#if !defined(HAVE_MSG_NOSIGNAL) +// MSG_NOSIGNAL is not available on some platforms, if it doesn't exist define it as 0 +#if !defined(MSG_NOSIGNAL) #define MSG_NOSIGNAL 0 #endif // MSG_DONTWAIT is not available on some platforms, if it doesn't exist define it as 0 -#if !defined(HAVE_MSG_DONTWAIT) +#if !defined(MSG_DONTWAIT) #define MSG_DONTWAIT 0 #endif diff --git a/src/netbase.cpp b/src/netbase.cpp index 3ea3141d5e..92ac1c4c85 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -21,7 +21,7 @@ #include // for to_lower() #include // for startswith() and endswith() -#if !defined(HAVE_MSG_NOSIGNAL) +#if !defined(MSG_NOSIGNAL) #define MSG_NOSIGNAL 0 #endif -- cgit v1.2.3