[openssh-commits] [openssh] 01/01: Check for missing ftruncate prototype.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Mar 9 09:34:30 AEDT 2022


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit c41c84b439f4cd74d4fe44298a4b4037ddd7d2ae
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Wed Mar 9 09:29:30 2022 +1100

    Check for missing ftruncate prototype.
    
    From github PR#301 in conjunction with rsbeckerca.
---
 configure.ac                    | 6 ++++++
 openbsd-compat/openbsd-compat.h | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/configure.ac b/configure.ac
index a165d087..41761c5b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2092,6 +2092,12 @@ AC_CHECK_DECLS([O_NONBLOCK], , ,
 #endif
 	])
 
+AC_CHECK_DECLS([ftruncate], , ,
+	[
+#include <sys/types.h>
+#include <unistd.h>
+	])
+
 AC_CHECK_DECLS([readv, writev], , , [
 #include <sys/types.h>
 #include <sys/uio.h>
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index c202e142..0cecfb62 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -65,6 +65,10 @@ int bindresvport_sa(int sd, struct sockaddr *sa);
 void closefrom(int);
 #endif
 
+#if defined(HAVE_DECL_FTRUNCATE) && HAVE_DECL_FTRUNCATE == 0
+int ftruncate(int filedes, off_t length);
+#endif
+
 #ifndef HAVE_GETLINE
 #include <stdio.h>
 ssize_t getline(char **, size_t *, FILE *);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list