[PATCH] core dump psinfo.pr_sname letter fix

Roland McGrath (roland@frob.com)
Tue, 6 May 2003 13:20:42 -0700


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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/