[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] kern: fix formatting of multiboot modules
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] kern: fix formatting of multiboot modules |
Date: |
Wed, 26 Mar 2014 00:32:57 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Wed 26 Mar 2014 00:02:08 +0100, a écrit :
> Previously, bootstrap_create would print the multiboot modules with
> padding applied to the end of the line. As multiboot modules as used
> by the Hurd span more than one line. This makes the list of modules
> hard to read and it looks unclean, more like an accident.
> Furthermore, it is not clear what the intend of this was, as the
> padding is applied at the end of the line, with no further information
> printed thereafter.
Ack.
> * kern/bootstrap.c (bootstrap_create): Remove variable maxlen and len,
> update printfs.
> ---
> kern/bootstrap.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/kern/bootstrap.c b/kern/bootstrap.c
> index 3e24d7b..7cfff3a 100644
> --- a/kern/bootstrap.c
> +++ b/kern/bootstrap.c
> @@ -150,7 +150,7 @@ void bootstrap_create(void)
> }
> else
> {
> - int i, losers, maxlen;
> + int i, losers;
>
> /* Initialize boot script variables. We leak these send rights. */
> losers = boot_script_set_variable
> @@ -241,15 +241,11 @@ void bootstrap_create(void)
> }
> #endif
>
> - maxlen = 0;
> for (i = 0; i < boot_info.mods_count; ++i)
> {
> int err;
> char *line = (char*)phystokv(bmods[i].string);
> - int len = strlen (line) + 1;
> - if (len > maxlen)
> - maxlen = len;
> - printf ("\rmodule %d: %*s", i, -maxlen, line);
> + printf ("module %d: %s\n", i, line);
> err = boot_script_parse_line (&bmods[i], line);
> if (err)
> {
> @@ -257,7 +253,7 @@ void bootstrap_create(void)
> ++losers;
> }
> }
> - printf ("\r%d multiboot modules %*s", i, -maxlen, "");
> + printf ("%d multiboot modules\n", i);
> if (losers)
> panic ("%d of %d boot script commands could not be parsed",
> losers, boot_info.mods_count);
> --
> 1.9.0
>
--
Samuel
La fonction memfrob() crypte les n premiers octets de la
zone de mémoire s en effectuant un OU-exclusif entre
chaque octet et le nombre 42.
(extrait de la page de man de memfrob -- Manuel du programmeur Linux)