diff options
author | Fred Wright <fw@fwright.net> | 2017-01-31 18:57:45 -0800 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2017-01-31 18:57:45 -0800 |
commit | 260ed80ab2e8e18ae208d34b6e8ad3b784155d62 (patch) | |
tree | d267b4646a27cece163f00aa163a0b6107862c70 /gpsd.c | |
parent | e9c2b6406ac76bb68f69a83a1694d5779b9779a9 (diff) | |
download | gpsd-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 */ |