logrotate: enable selinux support
[buildroot-gz.git] / package / nfs-utils / 0004-mountd-Add-check-for-struct-file_handle.patch
blob7aca266977dce37a45cd25606c4f5c2cb53370f7
1 From 3c23b3ea7f5069e8fd4d5758704cd968504f1079 Mon Sep 17 00:00:00 2001
2 From: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
3 Date: Tue, 2 Feb 2016 10:07:22 +0100
4 Subject: [PATCH] mountd: Add check for 'struct file_handle'
6 The code to check if name_to_handle_at() is implemented generates only a
7 warning but with some toolchain it doesn't fail to link (the function must be
8 implemented somewhere).
9 However the "struct file_handle" type is not available.
11 So, this patch adds a check for this struct.
13 Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
14 ---
15 configure.ac | 1 +
16 utils/mountd/cache.c | 2 +-
17 2 files changed, 2 insertions(+), 1 deletion(-)
19 diff --git a/configure.ac b/configure.ac
20 index 25d2ba4..913a86f 100644
21 --- a/configure.ac
22 +++ b/configure.ac
23 @@ -425,6 +425,7 @@ AC_TYPE_PID_T
24 AC_TYPE_SIZE_T
25 AC_HEADER_TIME
26 AC_STRUCT_TM
27 +AC_CHECK_TYPES([struct file_handle])
29 dnl *************************************************************
30 dnl Check for functions
31 diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
32 index 7847446..dc64f6d 100644
33 --- a/utils/mountd/cache.c
34 +++ b/utils/mountd/cache.c
35 @@ -424,7 +424,7 @@ static int same_path(char *child, char *parent, int len)
36 if (count_slashes(p) != count_slashes(parent))
37 return 0;
39 -#if HAVE_NAME_TO_HANDLE_AT
40 +#if defined(HAVE_NAME_TO_HANDLE_AT) && defined(HAVE_STRUCT_FILE_HANDLE)
41 struct {
42 struct file_handle fh;
43 unsigned char handle[128];
44 --
45 2.7.0