From 9af75365d2759fb8413631114aa9c3ef50ff8c71 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 9 Sep 2009 03:23:50 +0000 Subject: [PATCH] (trunk libT) a test commit -- possible fseek fix for Rabbitbunny --- configure.ac | 1 + libtransmission/inout.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d3fa88840..c04bdba1f 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,7 @@ PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM]) AC_PATH_ZLIB AC_SYS_LARGEFILE +AC_CHECK_FUNCS([lseek64]) dnl ---------------------------------------------------------------------------- diff --git a/libtransmission/inout.c b/libtransmission/inout.c index 5a2478aef..a0f3f00b1 100644 --- a/libtransmission/inout.c +++ b/libtransmission/inout.c @@ -10,6 +10,10 @@ * $Id$ */ +#ifdef HAVE_LSEEK64 + #define _LARGEFILE64_SOURCE +#endif + #include #include #include /* realloc */ @@ -51,9 +55,9 @@ enum { TR_IO_READ, TR_IO_WRITE }; int64_t tr_lseek( int fd, int64_t offset, int whence ) { -#if defined(_LARGEFILE_SOURCE) +#if defined( HAVE_LSEEK64 ) return lseek64( fd, (off64_t)offset, whence ); -#elif defined(WIN32) +#elif defined( WIN32 ) return _lseeki64( fd, offset, whence ); #else return lseek( fd, (off_t)offset, whence );