blob: 3fd727d5542dac4861b08dbb4feb48b5dfcad356 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$NetBSD: patch-aa,v 1.14 2011/01/24 18:54:04 drochner Exp $
--- modules/access/file.c.orig 2010-07-19 01:21:06.000000000 +0900
+++ modules/access/file.c 2011-01-04 22:05:25.000000000 +0900
@@ -52,6 +52,9 @@
#ifdef HAVE_LINUX_MAGIC_H
# include <sys/vfs.h>
# include <linux/magic.h>
+#elif defined (HAVE_FSTATVFS)
+# include <sys/statvfs.h>
+# include <sys/mount.h>
#endif
#if defined( WIN32 )
@@ -90,7 +93,12 @@
#ifndef WIN32
static bool IsRemote (int fd)
{
-#if defined (HAVE_FSTATVFS) && defined (MNT_LOCAL)
+#if !defined(__linux__) && defined(HAVE_FSTATVFS) && defined (MNT_LOCAL)
+ struct statvfs s;
+ if (fstatvfs(fd, &s))
+ return false;
+ return !(s.f_flag & MNT_LOCAL);
+#elif defined (HAVE_FSTATFS)
struct statvfs stf;
if (fstatvfs (fd, &stf))
|