summaryrefslogtreecommitdiff
path: root/lib/init.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2019-08-26 10:10:04 +0200
committerOndřej Lysoněk <olysonek@redhat.com>2019-09-02 13:42:00 +0200
commit4ab7331755d376cc003c954078c2c78ca8eae507 (patch)
tree784688d0373219db6cf761558e6b6de4a7032a8f /lib/init.c
parent7478a7da14d948e4cd738d515e1d20ab7e528701 (diff)
downloadlm-sensors-git-4ab7331755d376cc003c954078c2c78ca8eae507.tar.gz
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 <jdelvare@suse.de>
Diffstat (limited to 'lib/init.c')
-rw-r--r--lib/init.c3
1 files changed, 2 insertions, 1 deletions
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 <sys/types.h>
#include <sys/stat.h>