2003-05-06 20:08:15

by Roland McGrath

[permalink] [raw]
Subject: [PATCH] core dump psinfo.pr_sname letter fix

I noticed this a long time ago and forgot that it was still broken in 2.5.
This patch makes the state letter in the pr_sname field in core dumps
correct for stopped and zombie threads. The order needed to be changed when
the TASK_* values changed. This matches the letters used in sched.c:show_task.


Thanks,
Roland


--- linux-2.5.69/fs/binfmt_elf.c.~1~ Sun May 4 16:53:14 2003
+++ linux-2.5.69/fs/binfmt_elf.c Tue May 6 13:16:37 2003
@@ -1105,7 +1105,7 @@ static void fill_psinfo(struct elf_prpsi

i = p->state ? ffz(~p->state) + 1 : 0;
psinfo->pr_state = i;
- psinfo->pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
+ psinfo->pr_sname = (i < 0 || i > 5) ? '.' : "RSDTZW"[i];
psinfo->pr_zomb = psinfo->pr_sname == 'Z';
psinfo->pr_nice = task_nice(p);
psinfo->pr_flag = p->flags;