]> git.pld-linux.org Git - packages/transmission.git/blob - transmission-preallocate_syscall.patch
- updated for 1.90
[packages/transmission.git] / transmission-preallocate_syscall.patch
1 --- transmission-1.90/configure.ac.orig 2010-02-20 15:17:44.000000000 +0100
2 +++ transmission-1.90/configure.ac      2010-02-20 15:19:12.000000000 +0100
3 @@ -96,6 +96,14 @@
4  AC_HEADER_STDC
5  AC_HEADER_TIME
6  
7 +AC_MSG_CHECKING([for SYS_fallocate])
8 +AC_TRY_LINK([#include <sys/syscall.h>
9 +#include <sys/types.h>],
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])])
14 +
15  AC_CHECK_FUNCS([pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strtold syslog valloc])
16  AC_PROG_INSTALL
17  AC_PROG_MAKE_SET
18 --- transmission-1.83/libtransmission/fdlimit.c.orig    2010-01-29 02:01:32.000000000 +0100
19 +++ transmission-1.83/libtransmission/fdlimit.c 2010-02-07 05:53:09.000000000 +0100
20 @@ -43,6 +43,10 @@
21   #include <fcntl.h>
22  #endif
23  
24 +#ifdef HAVE_SYS_FALLOCATE
25 + #include <sys/syscall.h>
26 +#endif
27 +
28  #ifdef HAVE_XFS_XFS_H
29   #include <xfs/xfs.h>
30  #endif
31 @@ -168,6 +172,12 @@
32              success = !fcntl( fd, F_PREALLOCATE, &fst );
33          }
34  # endif
35 +# ifdef HAVE_SYS_FALLOCATE
36 +        if( !success )
37 +        {
38 +            success = !syscall( SYS_fallocate, fd, 0, (loff_t) 0, (loff_t) length );
39 +        }
40 +# endif
41  # ifdef HAVE_POSIX_FALLOCATE
42          if( !success )
43          {
This page took 0.074852 seconds and 3 git commands to generate.