]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-08-14 Felix Zielcke <fzielcke@z-51.de>
authorfzielcke <fzielcke@localhost>
Thu, 14 Aug 2008 18:46:47 +0000 (18:46 +0000)
committerfzielcke <fzielcke@localhost>
Thu, 14 Aug 2008 18:46:47 +0000 (18:46 +0000)
        * include/grub/err.h (grub_err_printf): New function prototype.
        * 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.

ChangeLog
include/grub/err.h
kern/err.c
kern/misc.c
util/misc.c

index 2a7ae8dd30ed0dde598002e8e035c20b066f6ae7..9e22291f2b56ee56e27331a01dc8c0e46c63c829 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-14  Felix Zielcke  <fzielcke@z-51.de>
+
+        * include/grub/err.h (grub_err_printf): New function prototype.
+        * 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.
+
 2008-08-13  Robert Millan  <rmh@aybabtu.com>
 
        * docs/grub.cfg: Remove `/dev/' prefix in GNU/Hurd boot entry.
index 317bda4362597a797f429da90ae28fe164aa33fa..50a9ea455ef0a19502c624770cb0a83140c23a0f 100644 (file)
@@ -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,7 @@ void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn));
 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)));
 
 #endif /* ! GRUB_ERR_HEADER */
index 837707971dbd2e106c819ecb26be208cf40c8707..8c78cb7b0cf1a2c8bd522cad439f1a83eb1805a4 100644 (file)
@@ -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 83fcc16847f3c51f8b1236734054b2949fc12741..bec6ebd334b8a3b6fca2f6920c275e6cfb7300db 100644 (file)
@@ -134,6 +134,11 @@ 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,
                   const char *fmt, ...)
index ce98665c87af1b78d8e8c645def779efca90b49a..7d877ccf3469e015acf6b3dc7fd55bae8b0848a6 100644 (file)
@@ -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,19 @@ 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)
 {