]> git.pld-linux.org Git - packages/transmission.git/blob - transmission-preallocate_syscall.patch
- ta_LK (Sri Lanka Tamil) unsupported, rel 2
[packages/transmission.git] / transmission-preallocate_syscall.patch
1 diff -ur transmission-2.30b1.orig/configure.ac transmission-2.30b1/configure.ac
2 --- transmission-2.30b1.orig/configure.ac       2011-04-01 03:28:41.000000000 +0200
3 +++ transmission-2.30b1/configure.ac    2011-04-08 14:31:31.233502737 +0200
4 @@ -108,6 +108,14 @@
5  AC_HEADER_STDC
6  AC_HEADER_TIME
7  
8 +AC_MSG_CHECKING([for SYS_fallocate])
9 +AC_TRY_LINK([#include <sys/syscall.h>
10 +#include <sys/types.h>],
11 +       [return syscall(SYS_fallocate, 0, 0, (loff_t) 0, (loff_t) 0);],
12 +       [AC_DEFINE([HAVE_SYS_FALLOCATE],[1],[Defined if you have the SYS_fallocate syscall number])
13 +       AC_MSG_RESULT([yes])],
14 +       [AC_MSG_RESULT([no])])
15 +
16  AC_CHECK_HEADERS([stdbool.h])
17  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 htonll ntohll])
18  AC_PROG_INSTALL
19 diff -ur transmission-2.30b1.orig/libtransmission/fdlimit.c transmission-2.30b1/libtransmission/fdlimit.c
20 --- transmission-2.30b1.orig/libtransmission/fdlimit.c  2011-04-01 03:28:34.000000000 +0200
21 +++ transmission-2.30b1/libtransmission/fdlimit.c       2011-04-08 14:34:14.120502738 +0200
22 @@ -29,6 +29,10 @@
23   #include <fcntl.h>
24  #endif
25  
26 +#ifdef HAVE_SYS_FALLOCATE
27 + #include <sys/syscall.h>
28 +#endif
29 +
30  #ifdef HAVE_FALLOCATE64
31    /* FIXME can't find the right #include voodoo to pick up the declaration.. */
32    extern int fallocate64( int fd, int mode, uint64_t offset, uint64_t len );
33 @@ -150,6 +154,14 @@
34              success = !fcntl( fd, F_PREALLOCATE, &fst );
35          }
36  # endif
37 +
38 +# ifdef HAVE_SYS_FALLOCATE
39 +       if( !success )
40 +       {
41 +           success = !syscall( SYS_fallocate, fd, 0, (loff_t) 0, (loff_t) length );
42 +       }
43 +# endif
44 +
45  # ifdef HAVE_POSIX_FALLOCATE
46          if( !success )
47          {
This page took 0.076074 seconds and 3 git commands to generate.