summaryrefslogtreecommitdiff
path: root/misc/root/patches/patch-aa
blob: b6c869b2554dccb4612cdb9c04ae2bfaa5ddf399 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$NetBSD: patch-aa,v 1.3 2010/02/26 10:56:38 drochner Exp $

--- core/unix/src/TUnixSystem.cxx.orig	2010-02-11 13:20:16.000000000 +0000
+++ core/unix/src/TUnixSystem.cxx
@@ -60,7 +60,7 @@
 #if defined(R__AIX) || defined(R__LINUX) || defined(R__ALPHA) || \
     defined(R__SGI) || defined(R__HIUX) || defined(R__FBSD) || \
     defined(R__OBSD) || defined(R__LYNXOS) || defined(R__MACOSX) || \
-    defined(R__HURD)
+    defined(R__HURD) || defined(__NetBSD__)
 #   include <sys/ioctl.h>
 #endif
 #if defined(R__AIX) || defined(R__SOLARIS)
@@ -86,8 +86,12 @@
 #   include <sys/param.h>
 #   include <sys/mount.h>
 #else
+#ifdef __NetBSD__
+#include <sys/statvfs.h>
+#else
 #   include <sys/statfs.h>
 #endif
+#endif
 
 #include <utime.h>
 #include <syslog.h>
@@ -182,7 +186,7 @@
 #elif defined(R__GLIBC) || defined(R__FBSD) || \
       (defined(R__SUNGCC3) && defined(__arch64__)) || \
       defined(R__OBSD) || defined(MAC_OS_X_VERSION_10_4) || \
-      (defined(R__AIX) && defined(_AIX43))
+      (defined(R__AIX) && defined(_AIX43)) || defined(__NetBSD__)
 #   define USE_SOCKLEN_T
 #endif
 
@@ -543,6 +547,7 @@ void TUnixSystem::SetProgname(const char
 //______________________________________________________________________________
 void TUnixSystem::SetDisplay()
 {
+#if 0
    // Set DISPLAY environment variable based on utmp entry. Only for UNIX.
 
    if (!Getenv("DISPLAY")) {
@@ -583,6 +588,7 @@ void TUnixSystem::SetDisplay()
          free(gUtmpContents);
       }
    }
+#endif
 }
 
 //______________________________________________________________________________
@@ -3822,7 +3828,11 @@ int TUnixSystem::UnixFSstat(const char *
    // The function returns 0 in case of success and 1 if the file system could
    // not be stat'ed.
 
+#ifdef __NetBSD__
+   struct statvfs statfsbuf;
+#else
    struct statfs statfsbuf;
+#endif
 #if defined(R__SGI) || (defined(R__SOLARIS) && !defined(R__LINUX))
    if (statfs(path, &statfsbuf, sizeof(struct statfs), 0) == 0) {
       *id = statfsbuf.f_fstyp;
@@ -3830,6 +3840,9 @@ int TUnixSystem::UnixFSstat(const char *
       *blocks = statfsbuf.f_blocks;
       *bfree = statfsbuf.f_bfree;
 #else
+#ifdef __NetBSD__
+   if (statvfs((char*)path, &statfsbuf) == 0) {
+#else
    if (statfs((char*)path, &statfsbuf) == 0) {
 #ifdef R__OBSD
       // Convert BSD filesystem names to Linux filesystem type numbers
@@ -3856,6 +3869,7 @@ int TUnixSystem::UnixFSstat(const char *
 #else
       *id = statfsbuf.f_type;
 #endif
+#endif
       *bsize = statfsbuf.f_bsize;
       *blocks = statfsbuf.f_blocks;
       *bfree = statfsbuf.f_bavail;