Created
November 14, 2014 21:38
-
-
Save tuxillo/bdf0842d6e2be33948ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c | |
index d102fab..a185db3 100644 | |
--- a/usr.bin/pkill/pkill.c | |
+++ b/usr.bin/pkill/pkill.c | |
@@ -68,8 +68,10 @@ | |
#define MAX_PID PID_MAX | |
/* 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)) | |
+#define IS_KTHREAD(kp) ((kp)->kp_pid <= 0 || ((kp)->kp_flags & P_SYSTEM) != 0) | |
+#define PSKIP(kp) ((kp)->kp_pid == mypid || \ | |
+ (!kthreads && (IS_KTHREAD(kp)))) || \ | |
+ ((!pgrep && kthreads) && IS_KTHREAD(kp)) | |
enum listtype { | |
LT_GENERIC, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment