From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KThUC-0007zo-CS for mharc-grub-devel@gnu.org; Thu, 14 Aug 2008 14:23:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KThUA-0007zU-FB for grub-devel@gnu.org; Thu, 14 Aug 2008 14:23:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KThU6-0007xu-Qx for grub-devel@gnu.org; Thu, 14 Aug 2008 14:23:46 -0400 Received: from [199.232.76.173] (port=48110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KThU6-0007xo-Aa for grub-devel@gnu.org; Thu, 14 Aug 2008 14:23:42 -0400 Received: from smtp-vbr11.xs4all.nl ([194.109.24.31]:3574) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KThU4-0004zs-24 for grub-devel@gnu.org; Thu, 14 Aug 2008 14:23:42 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id m7EINYZK088304 for ; Thu, 14 Aug 2008 20:23:34 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <1218558487.19045.8.camel@fz.local> <1218558734.19045.10.camel@fz.local> <87fxp9di59.fsf@xs4all.nl> <20080812224041.GB3141@thorin> <1218606980.4008.9.camel@fz.local> <87abfhb60p.fsf@xs4all.nl> <1218659496.25595.7.camel@fz.local> <20080813215023.GA23069@thorin> <1218667156.4010.5.camel@fz.local> <1218670230.4010.11.camel@fz.local> <87vdy4yspn.fsf@xs4all.nl> <1218711750.5154.11.camel@fz.local> Mail-Copies-To: mgerards@xs4all.nl Date: Thu, 14 Aug 2008 20:27:20 +0200 In-Reply-To: <1218711750.5154.11.camel@fz.local> (Felix Zielcke's message of "Thu, 14 Aug 2008 13:02:30 +0200") Message-ID: <8763q34flj.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: [PATCH] kern/err.c + disk/raid.c error handling fixes X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2008 18:23:46 -0000 Hi Felix, Felix Zielcke writes: [...] > 2008-08-14 Felix Zielcke > > * include/grub.err.h (grub_err_printf): New function prototype. grub.err.h -> grub/err.h > * util/misc.c (grub_err_printf): New function. > * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for > grub_printf. > * kern/err.c (grub_print_error): Use grub_err_printf. Looks fine to me. This patch looks clean enough for me :-). If you can correct the following (and previous ;)) comments, it is ready to be committed. > Index: kern/err.c > =================================================================== > --- kern/err.c (Revision 1804) > +++ kern/err.c (Arbeitskopie) > @@ -1,7 +1,7 @@ > /* err.c - error handling routines */ > /* > * GRUB -- GRand Unified Bootloader > - * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. > + * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. > * > * GRUB is free software: you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > @@ -121,14 +121,14 @@ grub_print_error (void) > do > { > if (grub_errno != GRUB_ERR_NONE) > - grub_printf ("error: %s\n", grub_errmsg); > + grub_err_printf ("error: %s\n", grub_errmsg); > } > while (grub_error_pop ()); > > /* If there was an assert while using error stack, report about it. */ > if (grub_error_stack_assert) > { > - grub_printf ("assert: error stack overflow detected!\n"); > + grub_err_printf ("assert: error stack overflow detected!\n"); > grub_error_stack_assert = 0; > } > } > Index: kern/misc.c > =================================================================== > --- kern/misc.c (Revision 1804) > +++ kern/misc.c (Arbeitskopie) > @@ -133,6 +133,10 @@ grub_printf (const char *fmt, ...) > > return ret; > } > +#ifndef GRUB_UTIL > +int grub_err_printf (const char *fmt, ...) > +__attribute__ ((alias("grub_printf"))); > +#endif > > void > grub_real_dprintf (const char *file, const int line, const char *condition, > Index: include/grub/err.h > =================================================================== > --- include/grub/err.h (Revision 1804) > +++ include/grub/err.h (Arbeitskopie) > @@ -1,7 +1,7 @@ > /* err.h - error numbers and prototypes */ > /* > * GRUB -- GRand Unified Bootloader > - * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. > + * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. > * > * GRUB is free software: you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > @@ -64,5 +64,6 @@ void EXPORT_FUNC(grub_fatal) (const char > void EXPORT_FUNC(grub_error_push) (void); > int EXPORT_FUNC(grub_error_pop) (void); > void EXPORT_FUNC(grub_print_error) (void); > +int EXPORT_FUNC(grub_err_printf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); Can you break the line somehow? It is too long. > #endif /* ! GRUB_ERR_HEADER */ > Index: util/misc.c > =================================================================== > --- util/misc.c (Revision 1804) > +++ util/misc.c (Arbeitskopie) > @@ -1,6 +1,6 @@ > /* > * GRUB -- GRand Unified Bootloader > - * Copyright (C) 2002,2003,2005,2006,2007 Free Software Foundation, Inc. > + * Copyright (C) 2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. > * > * GRUB is free software: you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > @@ -74,6 +74,18 @@ grub_util_error (const char *fmt, ...) > exit (1); > } > > +int > +grub_err_printf (const char *fmt, ...) > +{ > + va_list ap; > + int ret; > + > + va_start (ap, fmt); > + ret = vfprintf (stderr, fmt, ap); > + va_end (ap); > + > + return ret; > +} > void * > xmalloc (size_t size) Missing newline between the functions above. -- Marco