summaryrefslogtreecommitdiff
path: root/sysutils/pidof/patches/patch-aa
blob: 91c976ef8d4325f6d1e8be6634be22a6e88271f3 (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
82
83
$NetBSD: patch-aa,v 1.2 2019/12/31 13:55:14 mef Exp $

Disable the NFS code

--- src/killall5.c.orig	2019-09-12 02:43:12.000000000 +0900
+++ src/killall5.c	2019-12-31 22:43:43.093313776 +0900
@@ -44,7 +44,9 @@
 #include <errno.h>
 #include <getopt.h>
 #include <limits.h>
+#ifdef linux
 #include <mntent.h>
+#endif
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -253,6 +255,7 @@ static inline int isnetfs(const char * t
 	return 0;
 }
 
+#ifdef linux
 /*
  *     Remember all NFS typed partitions.
  */
@@ -318,6 +321,7 @@ void init_nfs(void)
 	}
 	endmntent(mnt);
 }
+#endif /* linux */
 
 static void clear_shadow(SHADOW *restrict shadow)
 {
@@ -396,6 +400,7 @@ static int maxsymlinks(void)
 	return v;
 }
 
+#ifdef linux
 /*
  *     Check path is located on a network based partition.
  */
@@ -465,6 +470,7 @@ int check4nfs(const char * path, char * 
 
 	return 0;
 }
+#endif /* linux */
 
 int readarg(FILE *fp, char *buf, int sz)
 {
@@ -683,10 +689,12 @@ int readproc(int do_stat)
 		p->nfs = 0;
 
 		switch (do_stat) {
+#ifdef linux
 		case DO_NETFS:
 			if ((p->nfs = check4nfs(path, buf)))
 				goto link;
                         /* else fall through */
+#endif
 		case DO_STAT:
 			if (stat(path, &st) != 0) {
 				char * ptr;
@@ -806,8 +814,10 @@ PIDQ_HEAD *pidof(char *prog)
 	if (prog[0] == '/') {
 		memset(&real[0], 0, sizeof(real));
 
+#ifdef linux
 		if (check4nfs(prog, real))
 			nfs++;
+#endif
 
 		if (real[0] != '\0')
 			prog = &real[0];	/* Binary located on network FS. */
@@ -1089,8 +1099,10 @@ int main_pidof(int argc, char **argv)
 		}
 	}
 
+#ifdef linux
 	if (flags & PIDOF_NETFS)
 		init_nfs();		/* Which network based FS are online? */
+#endif
 
 	/* Print out process-ID's one by one. */
 	readproc((flags & PIDOF_NETFS) ? DO_NETFS : DO_STAT);