X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Fproc%2Farray.c;h=0d6eb33597c6627f24586407f7e0a820454b3612;hb=3a1a8acf690873f0ee2d8a648c2ec185f4294bd2;hp=797d775e0354fca502c8ab439c4e986c8e27d237;hpb=66ee156078697cdc013d46aed3b2fee445c325a1;p=linux-2.6-omap-h63xx.git diff --git a/fs/proc/array.c b/fs/proc/array.c index 797d775e035..0d6eb33597c 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -80,6 +80,7 @@ #include #include #include +#include #include #include @@ -168,8 +169,12 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, rcu_read_lock(); ppid = pid_alive(p) ? task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0; - tpid = pid_alive(p) && p->ptrace ? - task_pid_nr_ns(rcu_dereference(p->parent), ns) : 0; + tpid = 0; + if (pid_alive(p)) { + struct task_struct *tracer = tracehook_tracer_task(p); + if (tracer) + tpid = task_pid_nr_ns(tracer, ns); + } seq_printf(m, "State:\t%s\n" "Tgid:\t%d\n"