summaryrefslogtreecommitdiff
path: root/emulators/pcemu/patches/patch-ac
blob: 8d4d83f366ab70d38aeed6aa2bdb0333430958d7 (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
$NetBSD: patch-ac,v 1.6 2006/01/12 19:48:02 joerg Exp $

--- mfs.c.orig	1994-06-22 14:24:51.000000000 +0000
+++ mfs.c
@@ -319,17 +319,24 @@ TODO:
 #include <errno.h>
 #include <sys/param.h>
 #include <stdlib.h>
+#if !__STDC__
 #include <malloc.h>
+#endif
 
-#ifdef SOLARIS
+#if defined(SOLARIS) || (defined(__NetBSD__) && __NetBSD_Version__ >= 299000900)
 #include <fcntl.h>
 #include <sys/statvfs.h>
 #endif
 
 #if defined(SGI) || defined(RS6000)
-#include <sys/statfs.h>
+# include <sys/statfs.h>
 #else
-#include <sys/vfs.h>
+# include <sys/param.h>
+# if BSD >= 199103
+#  include <sys/mount.h>
+# else
+#  include <sys/vfs.h>
+# endif /* new BSD */
 #endif
 
 
@@ -768,7 +775,7 @@ get_unix_attr(int mode, int attr)
 int
 get_disk_space(char *cwd, int *free, int *total)
 {
-#ifdef SOLARIS
+#if defined(SOLARIS) || (defined(__NetBSD__) && __NetBSD_Version__ >= 299000900)
     struct statvfs fsbuf;
     if (statvfs(cwd, &fsbuf) >= 0)
 #else
@@ -1182,8 +1189,6 @@ _get_dir(char *name, char *mname, char *
   (void) find_file(name, &sbuf);
 
   if ((cur_dir = opendir(name)) == NULL) {
-    extern int errno;
-
     Debug0((dbg_fd, "get_dir(): couldn't open '%s' errno = %s\n", name, strerror(errno)));
     return (NULL);
   }