]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib/compat.h: Remove PREAD_WRAPPERS workaround
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 13 Jun 2022 12:20:53 +0000 (14:20 +0200)
committerKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 4 Jul 2022 09:53:23 +0000 (11:53 +0200)
As this project defines a baseline system with
_XOPEN_SOURCE/_POSIX_C_SOURCE that includes pread for glibc, this
workaround can be removed.

m4/glibc.m4
src/lib/compat.c
src/lib/compat.h

index 0976938717bf7537086ae5c26ae304208218a3eb..f17aa4f739680518970db398073e3ef89d490319 100644 (file)
@@ -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 <features.h>
-      #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,[
index d47a8b2da7231843e902e8a1c4eed75d6fbb54b1..d4cebefcc4e5b6656ea9429411ebd333dfc169f8 100644 (file)
@@ -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
index f26e90ca600ce9b8a414a6c5d47cf332e515dd68..685518bd4ec3c90eb61a702a9e8a16936cdeccbf 100644 (file)
@@ -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