$NetBSD: patch-aa,v 1.3 2024/10/10 17:55:25 nia Exp $ Disable the NFS code --- src/killall5.c.orig 2019-09-11 17:43:12.000000000 +0000 +++ src/killall5.c @@ -44,12 +44,15 @@ #include #include #include +#ifdef linux #include +#endif #include #include #include #include #include +#include #include #include #include @@ -253,6 +256,7 @@ static inline int isnetfs(const char * t return 0; } +#ifdef linux /* * Remember all NFS typed partitions. */ @@ -318,6 +322,7 @@ void init_nfs(void) } endmntent(mnt); } +#endif /* linux */ static void clear_shadow(SHADOW *restrict shadow) { @@ -396,6 +401,7 @@ static int maxsymlinks(void) return v; } +#ifdef linux /* * Check path is located on a network based partition. */ @@ -465,6 +471,7 @@ int check4nfs(const char * path, char * return 0; } +#endif /* linux */ int readarg(FILE *fp, char *buf, int sz) { @@ -683,10 +690,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 +815,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 +1100,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);