summaryrefslogtreecommitdiff
path: root/x11-plugins/wmdf/files/wmdf_sys-fs.patch
blob: eefa3f1301ce41e356e453a5baafdee7dd205a02 (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
--- wmdf.c.orig	2005-07-06 10:03:10.000000000 +0200
+++ wmdf.c	2005-07-06 10:05:19.000000000 +0200
@@ -332,9 +332,10 @@
 	FILE *fp,*fd;
 	char mountpoint[255], dummy[255],devnme[255],fstype[255],options[255];
 	char s[255];
-
+	char *ref[] ={"none","proc","sysfs","usbfs","udev","devpts"};
 	unsigned int rio = 0,wio = 0,temprio = 0,tempwio = 0;
 	int i = 0;
+	int j=0;
 	int pos = 0;
 	int x;
 
@@ -342,13 +343,20 @@
 
 	if((fp = fopen("/etc/mtab","r")) != NULL) {
 
-	   while(!feof(fp)) {
-		   fscanf(fp,"%s %s %s %s %s %s\n",devnme,mountpoint,fstype,options,dummy,dummy);
-		   if((x = strcmp("none",devnme)) != 0) {
-			  add_disk(&cur_disk_infos,mountpoint,devnme,i);
-			   i++;
-		   }
-	   }
+	while(!feof(fp)) {
+		x=0;
+		fscanf(fp,"%s %s %s %s %s %s\n",devnme,mountpoint,fstype,options,dummy,dummy);
+		for (j=0;j<6;j++){
+			if(strcmp(ref[j],devnme)==0) {
+				x=1;
+				break;
+			}
+		}
+		if(x==0) {
+			add_disk(&cur_disk_infos,mountpoint,devnme,i);
+			i++;
+		}
+	}
 	} else { 
 		fprintf(stderr,"Error opening /etc/mtab\n");
 		return;