1From c512c877a7ca933bee980dcc1268a7319f233d59 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Fri, 2 Sep 2022 00:07:47 -0700 4Subject: [PATCH] Define prototype for safe_flock 5 6Upstream-Status: Pending 7Signed-off-by: Khem Raj <raj.khem@gmail.com> 8--- 9 src/osdep/unix/env_unix.c | 3 +++ 10 src/osdep/unix/mbx.c | 2 ++ 11 src/osdep/unix/os_lnx.h | 2 ++ 12 src/osdep/unix/os_slx.h | 3 +++ 13 src/osdep/unix/unix.c | 4 ++++ 14 5 files changed, 14 insertions(+) 15 16diff --git a/src/osdep/unix/env_unix.c b/src/osdep/unix/env_unix.c 17index 6b2c447..cefefca 100644 18--- a/src/osdep/unix/env_unix.c 19+++ b/src/osdep/unix/env_unix.c 20@@ -59,6 +59,9 @@ 21 #define S_IXOTH (S_IEXEC >> 6) 22 #endif 23 24+ 25+extern int safe_flock (int fd,int op); 26+ 27 /* c-client environment parameters */ 28 29 static char *myUserName = NIL; /* user name */ 30diff --git a/src/osdep/unix/mbx.c b/src/osdep/unix/mbx.c 31index 1ece5d8..c8a45a5 100644 32--- a/src/osdep/unix/mbx.c 33+++ b/src/osdep/unix/mbx.c 34@@ -41,12 +41,14 @@ extern int errno; /* just in case */ 35 #include "mail.h" 36 #include "osdep.h" 37 #include <pwd.h> 38+#include <utime.h> 39 #include <sys/stat.h> 40 #include <sys/time.h> 41 #include "misc.h" 42 #include "dummy.h" 43 #include "fdstring.h" 44 45+extern int safe_flock (int fd,int op); 46 47 /* Build parameters */ 48 49diff --git a/src/osdep/unix/os_lnx.h b/src/osdep/unix/os_lnx.h 50index b5f39ff..22c216b 100644 51--- a/src/osdep/unix/os_lnx.h 52+++ b/src/osdep/unix/os_lnx.h 53@@ -57,6 +57,8 @@ 54 55 #define direct dirent 56 57+extern int safe_flock (int fd,int op); 58+ 59 #define flock safe_flock 60 61 62diff --git a/src/osdep/unix/os_slx.h b/src/osdep/unix/os_slx.h 63index b5f39ff..c9adbcd 100644 64--- a/src/osdep/unix/os_slx.h 65+++ b/src/osdep/unix/os_slx.h 66@@ -46,11 +46,14 @@ 67 #include <sys/types.h> 68 #include <dirent.h> 69 #include <time.h> /* for struct tm */ 70+#include <utime.h> /* for struct tm */ 71 #include <fcntl.h> 72 #include <syslog.h> 73 #include <sys/file.h> 74 75 76+extern int safe_flock (int fd,int op); 77+ 78 /* Linux gets this wrong */ 79 80 #define setpgrp setpgid 81diff --git a/src/osdep/unix/unix.c b/src/osdep/unix/unix.c 82index be3c437..86be3f9 100644 83--- a/src/osdep/unix/unix.c 84+++ b/src/osdep/unix/unix.c 85@@ -45,6 +45,7 @@ extern int errno; /* just in case */ 86 #include "mail.h" 87 #include "osdep.h" 88 #include <time.h> 89+#include <utime.h> 90 #include <sys/stat.h> 91 #include "unix.h" 92 #include "pseudo.h" 93@@ -52,6 +53,9 @@ extern int errno; /* just in case */ 94 #include "misc.h" 95 #include "dummy.h" 96 97+ 98+extern int safe_flock (int fd,int op); 99+ 100 /* UNIX I/O stream local data */ 101 102 typedef struct unix_local { 103-- 1042.37.3 105 106