0004-mountd-Add-check-for-struct-file_handle.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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'
  5. The code to check if name_to_handle_at() is implemented generates only a
  6. warning but with some toolchain it doesn't fail to link (the function must be
  7. implemented somewhere).
  8. However the "struct file_handle" type is not available.
  9. So, this patch adds a check for this struct.
  10. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
  11. ---
  12. configure.ac | 1 +
  13. utils/mountd/cache.c | 2 +-
  14. 2 files changed, 2 insertions(+), 1 deletion(-)
  15. diff --git a/configure.ac b/configure.ac
  16. index 25d2ba4..913a86f 100644
  17. --- a/configure.ac
  18. +++ b/configure.ac
  19. @@ -425,6 +425,7 @@ AC_TYPE_PID_T
  20. AC_TYPE_SIZE_T
  21. AC_HEADER_TIME
  22. AC_STRUCT_TM
  23. +AC_CHECK_TYPES([struct file_handle])
  24. dnl *************************************************************
  25. dnl Check for functions
  26. diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
  27. index 7847446..dc64f6d 100644
  28. --- a/utils/mountd/cache.c
  29. +++ b/utils/mountd/cache.c
  30. @@ -424,7 +424,7 @@ static int same_path(char *child, char *parent, int len)
  31. if (count_slashes(p) != count_slashes(parent))
  32. return 0;
  33. -#if HAVE_NAME_TO_HANDLE_AT
  34. +#if defined(HAVE_NAME_TO_HANDLE_AT) && defined(HAVE_STRUCT_FILE_HANDLE)
  35. struct {
  36. struct file_handle fh;
  37. unsigned char handle[128];
  38. --
  39. 2.7.0