chiark / gitweb /
Fix service file to match installed elogind binary location
[elogind.git] / debian / patches / 0002-configure.ac-memshr_create-Detect-and-use-from-sys-m.patch
1 From: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 Date: Fri, 5 Oct 2018 22:43:34 +0100
3 Subject: configure.ac: memshr_create: Detect and use from <sys/mman.h>
4
5 Recent glibc versions do have a wrapper for this function.  It is available via
6 <sys/mman.h>.  So:
7   * Add <sys/mman.h> to the list of header checks.
8   * Add a conditional include of <sys/mman.h> to the configure test
9     for memshr_create, so that it will pass if the function is there.
10   * Add the same conditional include to missing.h, so that we
11     get it declared when we build.
12
13 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
14 ---
15  configure.ac        | 4 ++++
16  src/basic/missing.h | 4 ++++
17  2 files changed, 8 insertions(+)
18
19 diff --git a/configure.ac b/configure.ac
20 index c0ad243..9ec3390 100644
21 --- a/configure.ac
22 +++ b/configure.ac
23 @@ -358,6 +358,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
24  # ------------------------------------------------------------------------------
25  
26  AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
27 +AC_CHECK_HEADERS([sys/mman.h], [], [])
28  AC_CHECK_HEADERS([linux/memfd.h], [], [])
29  AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
30  
31 @@ -399,6 +400,9 @@ AC_CHECK_DECLS([
32  #include <sched.h>
33  #include <string.h>
34  #include <linux/loop.h>
35 +#ifdef HAVE_SYS_MMAN_H
36 +#include <sys/mman.h>
37 +#endif
38  ]])
39  
40  AC_CHECK_DECLS([getrandom],
41 diff --git a/src/basic/missing.h b/src/basic/missing.h
42 index c62c2db..e8508e7 100644
43 --- a/src/basic/missing.h
44 +++ b/src/basic/missing.h
45 @@ -55,6 +55,10 @@
46  #include <linux/btrfs.h>
47  #endif
48  
49 +#ifdef HAVE_SYS_MMAN_H
50 +#include <sys/mman.h>
51 +#endif
52 +
53  #ifdef HAVE_LINUX_VM_SOCKETS_H
54  #include <linux/vm_sockets.h>
55  #else