[dovecot-cvs] dovecot/src/lib compat.c,1.15,1.16 compat.h,1.22,1.23

cras at procontrol.fi cras at procontrol.fi
Wed Oct 29 16:19:30 EET 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv12071/lib

Modified Files:
	compat.c compat.h 
Log Message:
more kludgeing to get pread/pwrite working



Index: compat.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/compat.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- compat.c	29 Oct 2003 13:50:36 -0000	1.15
+++ compat.c	29 Oct 2003 14:19:28 -0000	1.16
@@ -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 <stdio.h>
 #include <ctype.h>
 #include <unistd.h>
@@ -135,6 +139,7 @@
 #endif
 
 #ifdef PREAD_WRAPPERS
+
 ssize_t my_pread(int fd, void *buf, size_t count, off_t offset)
 {
 	return pread(fd, buf, count, offset);

Index: compat.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/compat.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- compat.h	29 Oct 2003 13:50:36 -0000	1.22
+++ compat.h	29 Oct 2003 14:19:28 -0000	1.23
@@ -95,8 +95,10 @@
 #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



More information about the dovecot-cvs mailing list