summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCallum Farmer <gmbr3@opensuse.org>2022-09-11 12:57:05 +0100
committerCallum Farmer <gmbr3@opensuse.org>2022-09-11 12:57:05 +0100
commit468b76023a2dfb750c4d5e9b184f230c5b6ec670 (patch)
tree9d14dab4dbcaedc425043c52a520991c0a525638
parent0f46b67b45ef40854ad7924e836134bf3f920e09 (diff)
genauth: fix build with arc4random in glibc 2.36
HAVE_ARC4RANDOM is defined under glibc 2.36 but this will attempt to include <bsd/stdlib.h> from libbsd instead of <stdlib.h> from glibc Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
-rw-r--r--xdm/genauth.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xdm/genauth.c b/xdm/genauth.c
index 38a0215..de7abfc 100644
--- a/xdm/genauth.c
+++ b/xdm/genauth.c
@@ -42,7 +42,15 @@ from The Open Group.
#ifdef HAVE_ARC4RANDOM
# ifdef __linux__
-# include <bsd/stdlib.h>
+# if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+# if __GLIBC_PREREQ(2, 36)
+# include <stdlib.h>
+# else
+# include <bsd/stdlib.h>
+# endif
+# else
+# include <bsd/stdlib.h>
+# endif
# else
# include <stdlib.h>
# endif