File: 02_nfstype.patch

package info (click to toggle)
sup 20100519-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 780 kB
  • sloc: ansic: 8,334; makefile: 106
file content (31 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (4)
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
29
30
31
Index: sup-20091019/supfilesrv.c
===================================================================
--- sup-20091019.orig/supfilesrv.c	2009-10-17 22:46:03.000000000 +0200
+++ sup-20091019/supfilesrv.c	2009-10-20 17:24:24.000000000 +0200
@@ -260,6 +260,11 @@
 #include "libc.h"
 #include "c.h"
 
+#ifdef __linux__
+#include <sys/vfs.h>
+#define NFS_SUPER_MAGIC 0x6969
+#endif
+
 extern char *crypt(const char *, const char *);
 
 int maxchildren;
@@ -1932,6 +1937,14 @@
 			return (-1);
 		return strncmp(sf.f_fstypename, "nfs", 3) != 0;
 	}
+#elif defined(__linux__)
+	{
+		struct statfs sf;
+
+		if (fstatfs(handle, &sf) == -1)
+			return(-1);
+		return sf.f_type != NFS_SUPER_MAGIC;
+	}
 #else
 	if (major(sb.st_dev) == 255 || major(sb.st_dev) == 130)
 		return (0);