| @@ -1,30 +1,30 @@ | | | @@ -1,30 +1,30 @@ |
1 | $NetBSD: patch-aa,v 1.12 2010/06/20 15:58:06 wiz Exp $ | | 1 | $NetBSD: patch-aa,v 1.12.2.1 2010/07/04 20:11:31 tron Exp $ |
2 | | | 2 | |
3 | http://trac.videolan.org/vlc/ticket/3762 | | 3 | http://trac.videolan.org/vlc/ticket/3762 |
4 | | | 4 | |
5 | --- modules/access/file.c.orig 2009-09-18 19:37:45 +0300 | | 5 | --- modules/access/file.c.orig 2009-09-18 19:37:45 +0300 |
6 | +++ modules/access/file.c 2009-09-26 07:18:35 +0300 | | 6 | +++ modules/access/file.c 2009-09-26 07:18:35 +0300 |
7 | @@ -50,6 +50,9 @@ | | 7 | @@ -50,6 +50,9 @@ |
8 | #if defined (__linux__) | | 8 | #if defined (__linux__) |
9 | # include <sys/vfs.h> | | 9 | # include <sys/vfs.h> |
10 | # include <linux/magic.h> | | 10 | # include <linux/magic.h> |
11 | +#elif defined (HAVE_FSTATVFS) | | 11 | +#elif defined (HAVE_FSTATVFS) |
12 | +# include <sys/statvfs.h> | | 12 | +# include <sys/statvfs.h> |
13 | +# include <sys/mount.h> | | 13 | +# include <sys/mount.h> |
14 | #elif defined (HAVE_SYS_MOUNT_H) | | 14 | #elif defined (HAVE_SYS_MOUNT_H) |
15 | # include <sys/param.h> | | 15 | # include <sys/param.h> |
16 | # include <sys/mount.h> | | 16 | # include <sys/mount.h> |
17 | @@ -126,7 +129,12 @@ struct access_sys_t | | 17 | @@ -126,7 +129,12 @@ struct access_sys_t |
18 | | | 18 | |
19 | static bool IsRemote (int fd) | | 19 | static bool IsRemote (int fd) |
20 | { | | 20 | { |
21 | -#ifdef HAVE_FSTATFS | | 21 | -#ifdef HAVE_FSTATFS |
22 | +#ifdef HAVE_FSTATVFS | | 22 | +#if !defined(__linux__) && defined(HAVE_FSTATVFS) |
23 | + struct statvfs s; | | 23 | + struct statvfs s; |
24 | + if (fstatvfs(fd, &s)) | | 24 | + if (fstatvfs(fd, &s)) |
25 | + return false; | | 25 | + return false; |
26 | + return !(s.f_flag & MNT_LOCAL); | | 26 | + return !(s.f_flag & MNT_LOCAL); |
27 | +#elif defined (HAVE_FSTATFS) | | 27 | +#elif defined (HAVE_FSTATFS) |
28 | struct statfs stf; | | 28 | struct statfs stf; |
29 | | | 29 | |
30 | if (fstatfs (fd, &stf)) | | 30 | if (fstatfs (fd, &stf)) |