0005-exim_lock-fix-lstat-related-build-errors.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From bbcf4320134efd8a01ce5a02bb9af62019ca05f6 Mon Sep 17 00:00:00 2001
  2. From: Luca Ceresoli <luca@lucaceresoli.net>
  3. Date: Tue, 4 Feb 2020 15:57:48 +0100
  4. Subject: [PATCH] exim_lock: fix lstat-related build errors
  5. exim_lock fails to cross-compile with the Sourcery CodeBench ARM 2014.05
  6. toolchain due the a missing include of sys/types.h, needed for the
  7. constants used by fstat() and lstat().
  8. Discovered when cross-compiling with the Buildroot embedded Linux
  9. buildsystem.
  10. Fixes:
  11. exim_lock.c:427:30: error: 'S_IFMT' undeclared (first use in this function)
  12. if ((statbuf.st_mode & S_IFMT) == S_IFLNK)
  13. ^
  14. exim_lock.c:427:30: note: each undeclared identifier is reported only once for each function it appears in
  15. exim_lock.c:427:41: error: 'S_IFLNK' undeclared (first use in this function)
  16. if ((statbuf.st_mode & S_IFMT) == S_IFLNK)
  17. ^
  18. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
  19. Upstream-status: https://bugs.exim.org/show_bug.cgi?id=2523
  20. ---
  21. src/exim_lock.c | 3 +++
  22. 1 file changed, 3 insertions(+)
  23. diff --git a/src/exim_lock.c b/src/exim_lock.c
  24. index 068216816054..cb140aff6436 100644
  25. --- a/src/exim_lock.c
  26. +++ b/src/exim_lock.c
  27. @@ -13,6 +13,8 @@ Argument: the name of the lock file
  28. Copyright (c) The Exim Maintainers 2016
  29. */
  30. +#define _XOPEN_SOURCE
  31. +
  32. #include "os.h"
  33. #include <stdio.h>
  34. @@ -26,6 +28,7 @@ Copyright (c) The Exim Maintainers 2016
  35. #include <unistd.h>
  36. #include <utime.h>
  37. #include <sys/utsname.h>
  38. +#include <sys/types.h>
  39. #include <sys/stat.h>
  40. #include <sys/file.h>
  41. #include <pwd.h>
  42. --
  43. 2.25.0