Skip to content

Instantly share code, notes, and snippets.

@tuxillo
Created November 14, 2014 19:06
Show Gist options
  • Save tuxillo/d617a7c5df3f5aedd7cd to your computer and use it in GitHub Desktop.
Save tuxillo/d617a7c5df3f5aedd7cd to your computer and use it in GitHub Desktop.
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index d102fab..02f3159 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -69,7 +69,8 @@
/* Ignore system-processes (if '-S' flag is not specified) and myself. */
#define PSKIP(kp) ((kp)->kp_pid == mypid || \
- (!kthreads && ((kp)->kp_flags & P_KTHREADP) != 0))
+ (!kthreads && ((kp)->kp_flags & P_KTHREADP) != 0) || \
+ (!kthreads && ((kp)->kp_pid < 0)))
enum listtype {
LT_GENERIC,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment