[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201201251008.42120.vda.linux@googlemail.com>
Date: Wed, 25 Jan 2012 10:08:42 +0100
From: Denys Vlasenko <vda.linux@...glemail.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, Oleg Nesterov <oleg@...hat.com>
Subject: Re: [PATCH v2] If init dies, log a signal which killed it, if any.
On Wednesday 25 January 2012 01:20, Andrew Morton wrote:
> It's a bit user-hostile to print a hex number in such a context without
> the leading 0x. The %08 does provide a hint - users are unlikely to
> interpret 00000011 as 11. But still, I think...
>
> --- a/kernel/exit.c~kernel-exitc-if-init-dies-log-a-signal-which-killed-it-if-any-fix
> +++ a/kernel/exit.c
> @@ -711,7 +711,7 @@ static struct task_struct *find_new_reap
> if (unlikely(pid_ns->child_reaper == father)) {
> write_unlock_irq(&tasklist_lock);
> if (unlikely(pid_ns == &init_pid_ns)) {
> - panic("Attempted to kill init! exitcode=%08x\n",
> + panic("Attempted to kill init! exitcode=0x%08x\n",
> father->signal->group_exit_code ?:
> father->exit_code);
> }
> _
Looks good to me.
> Or maybe we should use %d. Does anyone use hex for exit codes?
I guess hex is better, considering that normal (non-signal) exit code
is stored in bits 8-15. It's more readable to see exit code 3 as 0x300
then as 768.
--
vda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists