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>
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
23 @@ -425,6 +425,7 @@ AC_TYPE_PID_T
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))
39 -#if HAVE_NAME_TO_HANDLE_AT
40 +#if defined(HAVE_NAME_TO_HANDLE_AT) && defined(HAVE_STRUCT_FILE_HANDLE)
42 struct file_handle fh;
43 unsigned char handle[128];