diff options
Diffstat (limited to 'src/libsystemd/sd-journal')
-rw-r--r-- | src/libsystemd/sd-journal/journal-send.c | 8 | ||||
-rw-r--r-- | src/libsystemd/sd-journal/journal-send.h | 5 | ||||
-rw-r--r-- | src/libsystemd/sd-journal/lookup3.c | 8 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c index 3b74d2246e..d0d29818c2 100644 --- a/src/libsystemd/sd-journal/journal-send.c +++ b/src/libsystemd/sd-journal/journal-send.c @@ -7,7 +7,7 @@ #include <sys/un.h> #include <unistd.h> #if HAVE_VALGRIND_VALGRIND_H -#include <valgrind/valgrind.h> +# include <valgrind/valgrind.h> #endif #define SD_JOURNAL_SUPPRESS_LOCATION @@ -77,9 +77,9 @@ int journal_fd_nonblock(bool nonblock) { return fd_nonblock(r, nonblock); } -#if VALGRIND void close_journal_fd(void) { - /* Be nice to valgrind. This is not atomic. This must be used only in tests. */ +#if HAVE_VALGRIND_VALGRIND_H + /* Be nice to valgrind. This is not atomic, so it is useful mainly for debugging. */ if (!RUNNING_ON_VALGRIND) return; @@ -92,8 +92,8 @@ void close_journal_fd(void) { safe_close(fd_plus_one - 1); fd_plus_one = 0; -} #endif +} _public_ int sd_journal_print(int priority, const char *format, ...) { int r; diff --git a/src/libsystemd/sd-journal/journal-send.h b/src/libsystemd/sd-journal/journal-send.h index 558d39a8c0..24315e249b 100644 --- a/src/libsystemd/sd-journal/journal-send.h +++ b/src/libsystemd/sd-journal/journal-send.h @@ -4,9 +4,4 @@ #include <stdbool.h> int journal_fd_nonblock(bool nonblock); - -#if VALGRIND void close_journal_fd(void); -#else -static inline void close_journal_fd(void) {} -#endif diff --git a/src/libsystemd/sd-journal/lookup3.c b/src/libsystemd/sd-journal/lookup3.c index 39967f21cd..a6a32e09c5 100644 --- a/src/libsystemd/sd-journal/lookup3.c +++ b/src/libsystemd/sd-journal/lookup3.c @@ -320,7 +320,9 @@ uint32_t jenkins_hashlittle( const void *key, size_t length, uint32_t initval) * still catch it and complain. The masking trick does make the hash * noticeably faster for short strings (like English words). */ -#if !VALGRIND && !HAS_FEATURE_ADDRESS_SANITIZER && !HAS_FEATURE_MEMORY_SANITIZER +#define VALGRIND_LIKE (HAVE_VALGRIND_VALGRIND_H || HAS_FEATURE_ADDRESS_SANITIZER || HAS_FEATURE_MEMORY_SANITIZER) + +#if !VALGRIND_LIKE switch(length) { @@ -505,7 +507,7 @@ void jenkins_hashlittle2( * still catch it and complain. The masking trick does make the hash * noticeably faster for short strings (like English words). */ -#if !VALGRIND && !HAS_FEATURE_ADDRESS_SANITIZER && !HAS_FEATURE_MEMORY_SANITIZER +#if !VALGRIND_LIKE switch(length) { @@ -681,7 +683,7 @@ uint32_t jenkins_hashbig( const void *key, size_t length, uint32_t initval) * still catch it and complain. The masking trick does make the hash * noticeably faster for short strings (like English words). */ -#if !VALGRIND && !HAS_FEATURE_ADDRESS_SANITIZER && !HAS_FEATURE_MEMORY_SANITIZER +#if !VALGRIND_LIKE switch(length) { |