0004-exim_lock-fix-lstat-related-build-errors.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. [Bernd: rebased for version 4.97.1]
  21. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  22. ---
  23. src/exim_lock.c | 3 +++
  24. 1 file changed, 3 insertions(+)
  25. diff --git a/src/exim_lock.c b/src/exim_lock.c
  26. index 068216816054..cb140aff6436 100644
  27. --- a/src/exim_lock.c
  28. +++ b/src/exim_lock.c
  29. @@ -14,6 +14,8 @@ Copyright (c) The Exim Maintainers 2016 - 2021
  30. SPDX-License-Identifier: GPL-2.0-or-later
  31. */
  32. +#define _XOPEN_SOURCE
  33. +
  34. #include "os.h"
  35. #include <stdio.h>
  36. @@ -27,6 +29,7 @@ Copyright (c) The Exim Maintainers 2016
  37. #include <unistd.h>
  38. #include <utime.h>
  39. #include <sys/utsname.h>
  40. +#include <sys/types.h>
  41. #include <sys/stat.h>
  42. #include <sys/file.h>
  43. #include <pwd.h>
  44. --
  45. 2.25.0