[Ocfs2-test-devel] [PATCH] splice: modify type of splice() of splice_test.h to ssize_t

tristan.ye tristan.ye at oracle.com
Mon Apr 13 00:38:47 PDT 2009


On Mon, 2009-04-13 at 15:03 +0800, Coly Li wrote:
> Current return value type of splice() of splice_test.h is int, which conflict
> with declaration of splice(2) in bits/fcntl.h. The conflict results compiling
> failure on several distributions (e.g. openSuSE 11.1).
> 
> This patch modifies the return value type from int to ssize_t, which fixes the
> compiling failure. Thanks to Trinstan who kindly gave me enlightenment on the
> fix :-)
> 
> Signed-off-by: Coly Li <coly.li at suse.de>
> Cc: Tristan Ye <tristan.ye at oracle.com>
> ---
>  programs/splice/splice_test.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/programs/splice/splice_test.h b/programs/splice/splice_test.h
> index 5113bbb..daf02a5 100644
> --- a/programs/splice/splice_test.h
> +++ b/programs/splice/splice_test.h
> @@ -31,7 +31,7 @@
>  #error unsupported arch
>  #endif
> 
> -int splice(int fdin, loff_t *off_in, int fdout,
> +ssize_t 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);

To make the testing src workable for all distributions, we may
explicitly change the system call splice() as my_splice() here to
prevent it from being conflicted by a declaration in bits/fcntl.h, and
then replace the splice() with my_splice in testing script
correspondingly.






More information about the Ocfs2-test-devel mailing list