summaryrefslogtreecommitdiff
path: root/x11/kdebase3/patches/patch-af
blob: bb0ab489017417c03320e1a18df88b931ca261da (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
$NetBSD: patch-af,v 1.6 2005/03/23 21:44:37 markd Exp $

--- kcontrol/info/info_netbsd.cpp.orig	2005-02-04 12:18:52.000000000 +1300
+++ kcontrol/info/info_netbsd.cpp
@@ -265,9 +265,11 @@ bool GetInfo_SCSI (QListView *lbox)
 bool GetInfo_Partitions (QListView *lbox)
 {
 	int num; // number of mounts
-	// FIXME: older pkgsrc patches checked ST_RDONLY for this declaration
-	// what is ST_RDONLY and how does it affect getmntinfo?
+#ifdef ST_RDONLY
+	struct statvfs *mnt; // mount data pointer
+#else
 	struct statfs *mnt; // mount data pointer
+#endif
 
 	// get mount info
 	if (!(num=getmntinfo(&mnt, MNT_WAIT))) {
@@ -290,7 +292,11 @@ bool GetInfo_Partitions (QListView *lbox
 		unsigned long long big[2];
 		QString vv[5];
 
+#ifdef ST_RDONLY
+		big[0] = big[1] = mnt->f_frsize; // coerce the product
+#else
 		big[0] = big[1] = mnt->f_bsize; // coerce the product
+#endif
 		big[0] *= mnt->f_blocks;
 		big[1] *= mnt->f_bavail; // FIXME: use f_bfree if root?
 
@@ -307,7 +313,11 @@ bool GetInfo_Partitions (QListView *lbox
 				.arg(mnt->f_files ? mnt->f_ffree*100/mnt->f_files : 0);
 
 		vv[4] = QString::null;
+#ifdef ST_RDONLY
+#define MNTF(x) if (mnt->f_flag & ST_##x) vv[4] += QString::fromLatin1(#x " ");
+#else
 #define MNTF(x) if (mnt->f_flags & MNT_##x) vv[4] += QString::fromLatin1(#x " ");
+#endif
 		MNTF(ASYNC)
 		MNTF(DEFEXPORTED)
 		MNTF(EXKERB)
@@ -316,7 +326,9 @@ bool GetInfo_Partitions (QListView *lbox
 		MNTF(EXPORTED)
 		MNTF(EXPUBLIC)
 		MNTF(EXRDONLY)
+#ifndef ST_RDONLY
 		MNTF(IGNORE)
+#endif
 		MNTF(LOCAL)
 		MNTF(NOATIME)
 		MNTF(NOCOREDUMP)