0001-src-s6-linux-utils-rngseed.c-fix-build-with-glibc.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 3ab8bdc1c657f91a2a96f4e6db308d17098de0c4 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Thu, 23 Feb 2023 12:09:11 +0100
  4. Subject: [PATCH] src/s6-linux-utils/rngseed.c: fix build with glibc <
  5. getrandom and sys/random.h are only available since glibc 2.25 resulting
  6. in the following build failure since version 2.6.0.0 and
  7. https://github.com/skarnet/s6-linux-utils/commit/ad5973028c42d947440cdae5e4f106152c3dda28:
  8. src/minutils/rngseed.c:15:24: fatal error: sys/random.h: No such file or directory
  9. #include <sys/random.h>
  10. ^
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/214bcecfc389cb412b68627c831300478d614a3a
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/skarnet/s6-linux-utils/pull/2]
  15. ---
  16. src/s6-linux-utils/rngseed.c | 2 ++
  17. 1 file changed, 2 insertions(+)
  18. diff --git a/src/minutils/rngseed.c b/src/minutils/rngseed.c
  19. index 2b1772c..223f50a 100644
  20. --- a/src/minutils/rngseed.c
  21. +++ b/src/minutils/rngseed.c
  22. @@ -12,7 +12,9 @@
  23. #include <unistd.h>
  24. #include <sys/stat.h>
  25. #include <sys/ioctl.h>
  26. +#ifdef SKALIBS_HASGETRANDOM
  27. #include <sys/random.h>
  28. +#endif
  29. #include <linux/random.h>
  30. #include <skalibs/types.h>
  31. --
  32. 2.39.1