]> git.pld-linux.org Git - packages/transmission.git/blame - transmission-preallocate_syscall.patch
- revert to 1.14, wrong branch added
[packages/transmission.git] / transmission-preallocate_syscall.patch
CommitLineData
f8328f9d 1--- transmission-2.21/configure.ac~ 2011-02-24 23:12:10.304798067 +0100
2+++ transmission-2.21/configure.ac 2011-02-24 23:14:30.981464735 +0100
3@@ -99,6 +99,14 @@
a1c29609
KK
4 AC_HEADER_STDC
5 AC_HEADER_TIME
f8328f9d 6
a1c29609
KK
7+AC_MSG_CHECKING([for SYS_fallocate])
8+AC_TRY_LINK([#include <sys/syscall.h>
9+#include <sys/types.h>],
fccbf9d7
CM
10+ [return syscall(SYS_fallocate, 0, 0, (loff_t) 0, (loff_t) 0);],
11+ [AC_DEFINE([HAVE_SYS_FALLOCATE],[1],[Defined if you have the SYS_fallocate syscall number])
12+ AC_MSG_RESULT([yes])],
13+ [AC_MSG_RESULT([no])])
a1c29609 14+
f8328f9d 15 AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs])
a1c29609 16 AC_PROG_INSTALL
f8328f9d 17 AC_PROG_MAKE_SET
18diff -ur transmission-2.00-orig//libtransmission/fdlimit.c transmission-2.00/libtransmission/fdlimit.c
19--- transmission-2.00-orig//libtransmission/fdlimit.c 2010-06-17 09:10:46.000000000 -0600
20+++ transmission-2.00/libtransmission/fdlimit.c 2010-06-18 17:06:22.000000000 -0600
21@@ -31,6 +31,10 @@
a1c29609
KK
22 #include <fcntl.h>
23 #endif
24
25+#ifdef HAVE_SYS_FALLOCATE
a1c29609
KK
26+ #include <sys/syscall.h>
27+#endif
28+
cdf28ec5 29 #ifdef HAVE_FALLOCATE64
30 /* FIXME can't find the right #include voodoo to pick up the declaration.. */
31 extern int fallocate64( int fd, int mode, uint64_t offset, uint64_t len );
f8328f9d 32@@ -168,6 +172,12 @@
a1c29609
KK
33 success = !fcntl( fd, F_PREALLOCATE, &fst );
34 }
35 # endif
36+# ifdef HAVE_SYS_FALLOCATE
f8328f9d 37+ if( !success )
38+ {
39+ success = !syscall( SYS_fallocate, fd, 0, (loff_t) 0, (loff_t) length );
40+ }
a1c29609
KK
41+# endif
42 # ifdef HAVE_POSIX_FALLOCATE
43 if( !success )
44 {
f8328f9d 45Only in transmission-2.00/libtransmission: fdlimit.c.orig
This page took 0.027066 seconds and 4 git commands to generate.