summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2017-01-31 18:57:45 -0800
committerFred Wright <fw@fwright.net>2017-01-31 18:57:45 -0800
commit260ed80ab2e8e18ae208d34b6e8ad3b784155d62 (patch)
treed267b4646a27cece163f00aa163a0b6107862c70 /gpsd.c
parente9c2b6406ac76bb68f69a83a1694d5779b9779a9 (diff)
downloadgpsd-260ed80ab2e8e18ae208d34b6e8ad3b784155d62.tar.gz
Fixes warning on CentOS build.
Certain definitions (in this case, setgroups) need _BSD_SOURCE in older glibc versions, but _DEFAULT_SOURCE in newer versions. The recommended approach for compatibility across glibc versions (from feature_test_macros(7)) is to define both. TESTED: Now builds without warnings on Ubuntu 14, CentOS 7, and Fedora 25.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index 8aa001d9..c14e09a5 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -10,8 +10,9 @@
/* FreeBSD chokes on this */
/* nice() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
-/* setgroups() needs _DEFAULT_SOURCE */
+/* setgroups() needs _DEFAULT_SOURCE or _BSD_SOURCE (glibc-dependent) */
#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
#endif /* __linux__ */
/* vsnprintf() needs __DARWIN_C_LEVEL >= 200112L */