aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypto/CMakeLists.txt4
-rw-r--r--crypto/Makefile.am4
-rw-r--r--crypto/compat/ftruncate.c17
-rw-r--r--crypto/compat/posix_win.c8
-rw-r--r--m4/check-libc.m41
5 files changed, 8 insertions, 26 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 491b9b4..0698ab4 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -637,10 +637,6 @@ if(NOT HAVE_FREEZERO)
637 set(COMPAT_SRC ${COMPAT_SRC} compat/freezero.c) 637 set(COMPAT_SRC ${COMPAT_SRC} compat/freezero.c)
638endif() 638endif()
639 639
640if(NOT HAVE_FTRUNCATE)
641 set(COMPAT_SRC ${COMPAT_SRC} compat/ftruncate.c)
642endif()
643
644if(NOT HAVE_GETDELIM) 640if(NOT HAVE_GETDELIM)
645 set(COMPAT_SRC ${COMPAT_SRC} compat/getdelim.c) 641 set(COMPAT_SRC ${COMPAT_SRC} compat/getdelim.c)
646endif() 642endif()
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index f703e33..7969aee 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -148,10 +148,6 @@ if !HAVE_FREEZERO
148libcompat_la_SOURCES += compat/freezero.c 148libcompat_la_SOURCES += compat/freezero.c
149endif 149endif
150 150
151if !HAVE_FTRUNCATE
152libcompat_la_SOURCES += compat/ftruncate.c
153endif
154
155if !HAVE_GETDELIM 151if !HAVE_GETDELIM
156libcompat_la_SOURCES += compat/getdelim.c 152libcompat_la_SOURCES += compat/getdelim.c
157endif 153endif
diff --git a/crypto/compat/ftruncate.c b/crypto/compat/ftruncate.c
deleted file mode 100644
index e825e50..0000000
--- a/crypto/compat/ftruncate.c
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * Public domain
3 *
4 * Kinichiro Inoguchi <inoguchi@openbsd.org>
5 */
6
7#ifdef _WIN32
8
9#include <unistd.h>
10
11int
12ftruncate(int fd, off_t length)
13{
14 return _chsize(fd, length);
15}
16
17#endif
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c
index 4e98643..60b2896 100644
--- a/crypto/compat/posix_win.c
+++ b/crypto/compat/posix_win.c
@@ -68,6 +68,14 @@ libressl_fstat(int fd, struct stat *statbuf)
68 return fstat(get_real_fd(fd), statbuf); 68 return fstat(get_real_fd(fd), statbuf);
69} 69}
70 70
71#ifndef HAVE_FTRUNCATE
72int
73ftruncate(int fd, off_t length)
74{
75 return _chsize(get_real_fd(fd), length);
76}
77#endif
78
71int 79int
72posix_open(const char *path, ...) 80posix_open(const char *path, ...)
73{ 81{
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4
index 42867cc..8ecc89a 100644
--- a/m4/check-libc.m4
+++ b/m4/check-libc.m4
@@ -39,7 +39,6 @@ AC_CACHE_CHECK([for getpagesize], ac_cv_func_getpagesize, [
39]) 39])
40AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes]) 40AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes])
41AM_CONDITIONAL([HAVE_FREEZERO], [test "x$ac_cv_func_freezero" = xyes]) 41AM_CONDITIONAL([HAVE_FREEZERO], [test "x$ac_cv_func_freezero" = xyes])
42AM_CONDITIONAL([HAVE_FTRUNCATE], [test "x$ac_cv_func_ftruncate" = xyes])
43AM_CONDITIONAL([HAVE_GETDELIM], [test "x$ac_cv_func_getdelim" = xyes]) 42AM_CONDITIONAL([HAVE_GETDELIM], [test "x$ac_cv_func_getdelim" = xyes])
44AM_CONDITIONAL([HAVE_GETLINE], [test "x$ac_cv_func_getline" = xyes]) 43AM_CONDITIONAL([HAVE_GETLINE], [test "x$ac_cv_func_getline" = xyes])
45AM_CONDITIONAL([HAVE_GETPAGESIZE], [test "x$ac_cv_func_getpagesize" = xyes]) 44AM_CONDITIONAL([HAVE_GETPAGESIZE], [test "x$ac_cv_func_getpagesize" = xyes])