changeset 1852:29729fa90bb2 HEAD

more kludgeing to get pread/pwrite working
author Timo Sirainen <tss@iki.fi>
date Wed, 29 Oct 2003 16:19:28 +0200
parents d66d53f57e43
children 0fd7dbda6704
files src/lib/compat.c src/lib/compat.h
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/compat.c	Wed Oct 29 16:10:20 2003 +0200
+++ b/src/lib/compat.c	Wed Oct 29 16:19:28 2003 +0200
@@ -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);
--- a/src/lib/compat.h	Wed Oct 29 16:10:20 2003 +0200
+++ b/src/lib/compat.h	Wed Oct 29 16:19:28 2003 +0200
@@ -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