From a1f9ef061542624eb397dac481e805d678b43ea1 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 30 Sep 2020 22:18:13 +0200 Subject: [PATCH] Fix the build when _GNU_SOURCE is defined to a non-empty value Fix #3432. Signed-off-by: Gilles Peskine --- ChangeLog.d/_GNU_SOURCE-redefined.txt | 3 +++ library/entropy_poll.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 ChangeLog.d/_GNU_SOURCE-redefined.txt diff --git a/ChangeLog.d/_GNU_SOURCE-redefined.txt b/ChangeLog.d/_GNU_SOURCE-redefined.txt new file mode 100644 index 000000000..59c8a153f --- /dev/null +++ b/ChangeLog.d/_GNU_SOURCE-redefined.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix the build when the macro _GNU_SOURCE is defined to a non-empty value. + Fix #3432. diff --git a/library/entropy_poll.c b/library/entropy_poll.c index 4bf660e05..5250a7bfe 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c @@ -17,7 +17,7 @@ * limitations under the License. */ -#if defined(__linux__) +#if defined(__linux__) && !defined(_GNU_SOURCE) /* Ensure that syscall() is available even when compiling with -std=c99 */ #define _GNU_SOURCE #endif