aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_procs.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_procs.c')
-rw-r--r--plugins/check_procs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index d20b027f..c2239dba 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -123,6 +123,7 @@ main (int argc, char **argv)
char *procprog;
pid_t mypid = 0;
+ pid_t myppid = 0;
struct stat statbuf;
dev_t mydev = 0;
ino_t myino = 0;
@@ -172,6 +173,7 @@ main (int argc, char **argv)
/* find ourself */
mypid = getpid();
+ myppid = getppid();
if (usepid || stat_exe(mypid, &statbuf) == -1) {
/* usepid might have been set by -T */
usepid = 1;
@@ -241,6 +243,12 @@ main (int argc, char **argv)
printf("not considering - is myself or gone\n");
continue;
}
+ /* Ignore parent*/
+ else if (myppid == procpid) {
+ if (verbose >= 3)
+ printf("not considering - is parent\n");
+ continue;
+ }
/* filter kernel threads (childs of KTHREAD_PARENT)*/
/* TODO adapt for other OSes than GNU/Linux