[Ocfs2-test-devel] [PATCH] splice: fix splice() conflicted definitions
Coly Li
coly.li at suse.de
Fri Mar 20 10:54:32 PDT 2009
the splice() defined in programs/splice/splice_test.h is conflicted with the one
defined in /usr/include/bits/fcntl.h, which results a compiling error:
splice_test.h:35: error: conflicting types for ‘splice’
/usr/include/bits/fcntl.h:244: error: previous declaration of ‘splice’ was here
This patch fixes the compiling error. When people wants to test the code with
splice() from libc, just define USE_LIBC_SPLICE.
Signed-off-by: Coly Li <coly.li at suse.de>
---
programs/splice/splice_test.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/programs/splice/splice_test.h b/programs/splice/splice_test.h
index 5113bbb..9a223d3 100644
--- a/programs/splice/splice_test.h
+++ b/programs/splice/splice_test.h
@@ -31,9 +31,12 @@
#error unsupported arch
#endif
-int splice(int fdin, loff_t *off_in, int fdout,
+int test_splice(int fdin, loff_t *off_in, int fdout,
loff_t *off_out, size_t len, unsigned int flags)
{
return syscall(__NR_splice, fdin, off_in, fdout, off_out, len, flags);
}
+#ifndef USE_LIBC_SPLICE
+#define splice test_splice
+#endif
--
Coly Li
SuSE Labs
More information about the Ocfs2-test-devel
mailing list