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