diff options
author | Patrick Steinhardt <ps@pks.im> | 2019-08-26 13:58:03 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2019-08-26 14:02:15 -0400 |
commit | d55099422a36cb57680618730ac6ea255c9dd8f6 (patch) | |
tree | d791fb2d437bf59fa45e2a39981f0a3913487691 /utils | |
parent | 2dcce8eca948487c5306bd43f312e3a5594c8f43 (diff) | |
download | nfs-utils-d55099422a36cb57680618730ac6ea255c9dd8f6.tar.gz |
mount: fix compilation if __GLIBC__ is not defined
As glibc versions before v2.24 couldn't safely include <linux/in6.h>,
commit 8af595b7 (mount: support compiling with old glibc, 2017-07-26)
introduced some preprocessor checks to special-case such old versions.
While there is a check whether __GLIBC__ is defined at all, it only
applies to the first comparison `__GLIBC__ < 2`, but doesn't apply to
the second check due to operator precedence. Thus the preprocessor may
use an undefined value and thus generate an error if __GLIBC__ is not
defined.
Fix the issue by wrapping the version check in braces.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/mount/network.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c index e166a823..6ac913d9 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -39,7 +39,7 @@ #include <sys/socket.h> #include <sys/wait.h> #include <sys/stat.h> -#if defined(__GLIBC__) && (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24) +#if defined(__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) /* Cannot safely include linux/in6.h in old glibc, so hardcode the needed values */ # define IPV6_PREFER_SRC_PUBLIC 2 # define IPV6_ADDR_PREFERENCES 72 |