From e082548030bc06153d6bb7537e6f28148bca62b5 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 14 Jun 2009 18:32:09 +0000 Subject: [PATCH] (trunk) remove the test for fallocate(), since we used posix_fallocate() as a fallback anyway. says: "Glibc does have posix_fallocate(), which implements the POSIX interface. posix_fallocate() is wired to use the fallocate system call, for sufficiently modern versions of glibc." --- configure.ac | 6 ------ libtransmission/fdlimit.c | 10 ---------- 2 files changed, 16 deletions(-) diff --git a/configure.ac b/configure.ac index 16f19e808..c70280584 100644 --- a/configure.ac +++ b/configure.ac @@ -81,12 +81,6 @@ fi AC_HEADER_STDC AC_HEADER_TIME -AC_MSG_CHECKING([for fallocate]) -AC_TRY_LINK([#include ], - [return fallocate(-1,0,0,0);], - [AC_DEFINE([HAVE_FALLOCATE],[1],[Defined if fallocate() exists]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) AC_CHECK_FUNCS([lrintf strlcpy daemon dirname basename daemon strcasecmp localtime_r posix_fallocate memmem]) AC_PROG_INSTALL AC_PROG_MAKE_SET diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index 3a3e3c143..f3e2224c5 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -43,10 +43,6 @@ #include #endif -#ifdef HAVE_FALLOCATE - #include -#endif - #ifdef HAVE_XFS_XFS_H #include #endif @@ -180,12 +176,6 @@ preallocateFileFull( const char * filename, uint64_t length ) success = !fcntl( fd, F_PREALLOCATE, &fst ); } # endif -# ifdef HAVE_FALLOCATE - if( !success ) - { - success = !fallocate( fd, FALLOC_FL_KEEP_SIZE, 0, length ); - } -# endif # ifdef HAVE_POSIX_FALLOCATE if( !success ) {