From: Karl Fleischmann Date: Mon, 13 Jun 2022 12:20:53 +0000 (+0200) Subject: lib/compat.h: Remove PREAD_WRAPPERS workaround X-Git-Tag: 2.4.0~3825 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d008408330fc699ec091394c6be2e33d9ab33ef1;p=thirdparty%2Fdovecot%2Fcore.git lib/compat.h: Remove PREAD_WRAPPERS workaround As this project defines a baseline system with _XOPEN_SOURCE/_POSIX_C_SOURCE that includes pread for glibc, this workaround can be removed. --- diff --git a/m4/glibc.m4 b/m4/glibc.m4 index 0976938717..f17aa4f739 100644 --- a/m4/glibc.m4 +++ b/m4/glibc.m4 @@ -1,19 +1,4 @@ AC_DEFUN([DOVECOT_GLIBC], [ - AC_CACHE_CHECK([whether we have glibc],i_cv_have_glibc,[ - AC_EGREP_CPP([we have glibc], [ - #include - #ifdef __GNU_LIBRARY__ - we have glibc - #endif - ], [ - i_cv_have_glibc=yes - ], [ - i_cv_have_glibc=no - ]) - ]) - AS_IF([test "$i_cv_have_glibc" = "yes"], [ - AC_DEFINE(PREAD_WRAPPERS,, [Define if pread/pwrite needs _XOPEN_SOURCE 500]) - ]) dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. dnl * It may also be broken in AIX. AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ diff --git a/src/lib/compat.c b/src/lib/compat.c index d47a8b2da7..d4cebefcc4 100644 --- a/src/lib/compat.c +++ b/src/lib/compat.c @@ -56,18 +56,4 @@ ssize_t i_my_pwrite(int fd, const void *buf, size_t count, off_t offset) return -1; return ret; } -#elif defined(PREAD_WRAPPERS) - -ssize_t i_my_pread(int fd, void *buf, size_t count, off_t offset) -{ - ssize_t ret; - - ret = pread(fd, buf, count, offset); - return ret; -} - -ssize_t i_my_pwrite(int fd, const void *buf, size_t count, off_t offset) -{ - return pwrite(fd, buf, count, offset); -} #endif diff --git a/src/lib/compat.h b/src/lib/compat.h index f26e90ca60..685518bd4e 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -159,7 +159,7 @@ struct const_iovec { * * */ -#if !defined(HAVE_PREAD) || defined(PREAD_WRAPPERS) +#if !defined(HAVE_PREAD) # ifndef IN_COMPAT_C # define pread i_my_pread # define pwrite i_my_pwrite