From: Timo Sirainen Date: Wed, 29 Oct 2003 14:19:28 +0000 (+0200) Subject: more kludgeing to get pread/pwrite working X-Git-Tag: 1.1.alpha1~4254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1510dbbe1a319967e72e5b6d04083cfb72b1d0f0;p=thirdparty%2Fdovecot%2Fcore.git more kludgeing to get pread/pwrite working --HG-- branch : HEAD --- diff --git a/src/lib/compat.c b/src/lib/compat.c index d75249b73b..cc13be1662 100644 --- a/src/lib/compat.c +++ b/src/lib/compat.c @@ -1,11 +1,15 @@ /* Copyright (c) 2002-2003 Timo Sirainen */ -#include "lib.h" +#include "config.h" +#undef HAVE_CONFIG_H #ifdef PREAD_WRAPPERS # define _XOPEN_SOURCE 500 /* Linux */ #endif +#define IN_COMPAT_C +#include "lib.h" + #include #include #include @@ -135,6 +139,7 @@ ssize_t my_pwrite(int fd, const void *buf, size_t count, off_t offset) #endif #ifdef PREAD_WRAPPERS + ssize_t my_pread(int fd, void *buf, size_t count, off_t offset) { return pread(fd, buf, count, offset); diff --git a/src/lib/compat.h b/src/lib/compat.h index ab6578bf70..ca56a07d5a 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -95,8 +95,10 @@ ssize_t my_writev(int fd, const struct iovec *iov, int iov_len); #endif #if !defined (HAVE_PREAD) || defined (PREAD_WRAPPERS) -# define pread my_pread -# define pwrite my_pwrite +# ifndef IN_COMPAT_C +# define pread my_pread +# define pwrite my_pwrite +# endif ssize_t my_pread(int fd, void *buf, size_t count, off_t offset); ssize_t my_pwrite(int fd, const void *buf, size_t count, off_t offset); #endif