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