From 4ab7331755d376cc003c954078c2c78ca8eae507 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 26 Aug 2019 10:10:04 +0200 Subject: [PATCH] libsensors: Prevent warning with glibc >= 2.20 Since glibc 2.20, the usage of _BSD_SOURCE is deprecated. Fix it like described here: https://sourceware.org/glibc/wiki/Release/2.20#Deprecation_of__BSD_SOURCE_and__SVID_SOURCE_feature_macros Inspired from a similar patch by Wolfram Sang for i2c-tools. Signed-off-by: Jean Delvare --- lib/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/init.c b/lib/init.c index 33bee0f2..1e053444 100644 --- a/lib/init.c +++ b/lib/init.c @@ -20,7 +20,8 @@ */ /* Needed for scandir() and alphasort() */ -#define _BSD_SOURCE +#define _BSD_SOURCE 1 /* for glibc < 2.19 */ +#define _DEFAULT_SOURCE 1 /* for glibc >= 2.19 */ #include #include