summaryrefslogtreecommitdiff
path: root/misc/root/patches/patch-aa
blob: 4d32176dd93f8c3b4e36ce9513ef3046dd5bce4e (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.2 2006/05/27 12:38:27 drochner Exp $

--- unix/src/TUnixSystem.cxx.orig	2006-05-26 16:51:20.000000000 +0200
+++ unix/src/TUnixSystem.cxx
@@ -62,7 +62,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)
@@ -87,8 +87,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>
@@ -174,7 +178,7 @@
 #elif defined(R__GLIBC) || (defined(R__FBSD) && defined(R__ALPHA)) || \
       (defined(R__SUNGCC3) && defined(__arch64__)) || \
       defined(MAC_OS_X_VERSION_10_4) || \
-      (defined(R__AIX) && defined(_AIX43))
+      (defined(R__AIX) && defined(_AIX43) || defined(__NetBSD__))
 #   define USE_SOCKLEN_T
 #endif
 
@@ -411,6 +415,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")) {
@@ -451,6 +456,7 @@ void TUnixSystem::SetDisplay()
          free(gUtmpContents);
       }
    }
+#endif
 }
 
 //______________________________________________________________________________
@@ -3446,7 +3452,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;
@@ -3454,6 +3464,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
@@ -3480,6 +3493,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;