diff options
author | Gilles Chehade <gilles@poolp.org> | 2019-11-17 13:31:23 +0100 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2019-11-17 13:31:23 +0100 |
commit | 8458fb97e585cf8754c021e7e65fe1eaf9742fd4 (patch) | |
tree | 86bc295daaf74c8261ebedc6379728a522880c19 | |
parent | remove openbsd-compat functions that are unused in the project (diff) | |
download | OpenSMTPD-8458fb97e585cf8754c021e7e65fe1eaf9742fd4.tar.xz OpenSMTPD-8458fb97e585cf8754c021e7e65fe1eaf9742fd4.zip |
truncate() is not used in the project
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.c | 19 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 4 |
3 files changed, 0 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index 25748b7d..a1380596 100644 --- a/configure.ac +++ b/configure.ac @@ -559,7 +559,6 @@ AC_CHECK_FUNCS([ \ sysconf \ tcgetpgrp \ time \ - truncate \ vasprintf \ vsnprintf \ waitpid \ diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 4d786a36..b17393c1 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -92,25 +92,6 @@ const char *strerror(int e) } #endif -#ifndef HAVE_TRUNCATE -int truncate(const char *path, off_t length) -{ - int fd, ret, saverrno; - - fd = open(path, O_WRONLY); - if (fd < 0) - return (-1); - - ret = ftruncate(fd, length); - saverrno = errno; - close(fd); - if (ret == -1) - errno = saverrno; - - return(ret); -} -#endif /* HAVE_TRUNCATE */ - #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) int nanosleep(const struct timespec *req, struct timespec *rem) { diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index cddbbdbc..31d0d7c3 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -54,10 +54,6 @@ struct timeval { } #endif /* HAVE_STRUCT_TIMEVAL */ -#ifndef HAVE_TRUNCATE -int truncate (const char *, off_t); -#endif /* HAVE_TRUNCATE */ - #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) #ifndef HAVE_STRUCT_TIMESPEC struct timespec { |