* grub-core/kern/misc.c (grub_abort): Make static

This commit is contained in:
Vladimir Serbinenko 2013-10-27 14:13:39 +01:00
parent a60dae7e4e
commit a8f15bceea
7 changed files with 19 additions and 21 deletions

View file

@ -1,3 +1,7 @@
2013-10-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/misc.c (grub_abort): Make static
2013-10-21 Vladimir Serbinenko <phcoder@gmail.com> 2013-10-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/misc.c (grub_vsnprintf_real): Don't attempt to * grub-core/kern/misc.c (grub_vsnprintf_real): Don't attempt to

View file

@ -216,7 +216,7 @@ grub_gdb_trap (int trap_no)
grub_backtrace_print_address ((void *) grub_gdb_regs[PC]); grub_backtrace_print_address ((void *) grub_gdb_regs[PC]);
grub_printf ("\n"); grub_printf ("\n");
grub_backtrace_pointer ((void *) grub_gdb_regs[EBP]); grub_backtrace_pointer ((void *) grub_gdb_regs[EBP]);
grub_abort (); grub_fatal ("Unhandled exception");
} }
sig_no = grub_gdb_trap2sig (trap_no); sig_no = grub_gdb_trap2sig (trap_no);

View file

@ -511,7 +511,7 @@ grub_efi_mm_init (void)
grub_printf ("printing memory map\n"); grub_printf ("printing memory map\n");
print_memory_map (memory_map, desc_size, print_memory_map (memory_map, desc_size,
NEXT_MEMORY_DESCRIPTOR (memory_map, map_size)); NEXT_MEMORY_DESCRIPTOR (memory_map, map_size));
grub_abort (); grub_fatal ("Debug. ");
#endif #endif
/* Release the memory maps. */ /* Release the memory maps. */

View file

@ -47,18 +47,6 @@ grub_error (grub_err_t n, const char *fmt, ...)
return n; return n;
} }
void
grub_fatal (const char *fmt, ...)
{
va_list ap;
va_start (ap, fmt);
grub_vprintf (_(fmt), ap);
va_end (ap);
grub_abort ();
}
void void
grub_error_push (void) grub_error_push (void)
{ {

View file

@ -1067,7 +1067,7 @@ grub_xasprintf (const char *fmt, ...)
} }
/* Abort GRUB. This function does not return. */ /* Abort GRUB. This function does not return. */
void static void __attribute__ ((noreturn))
grub_abort (void) grub_abort (void)
{ {
grub_printf ("\nAborted."); grub_printf ("\nAborted.");
@ -1083,10 +1083,17 @@ grub_abort (void)
grub_exit (); grub_exit ();
} }
#if ! defined (__APPLE__) && !defined (GRUB_UTIL) void
/* GCC emits references to abort(). */ grub_fatal (const char *fmt, ...)
void abort (void) __attribute__ ((alias ("grub_abort"))); {
#endif va_list ap;
va_start (ap, fmt);
grub_vprintf (_(fmt), ap);
va_end (ap);
grub_abort ();
}
#if NEED_REGISTER_FRAME_INFO && !defined(GRUB_UTIL) #if NEED_REGISTER_FRAME_INFO && !defined(GRUB_UTIL)
void __register_frame_info (void) void __register_frame_info (void)

View file

@ -115,7 +115,7 @@ void _gcry_log_bug (const char *fmt, ...)
grub_vprintf (fmt, args); grub_vprintf (fmt, args);
va_end (args); va_end (args);
grub_refresh (); grub_refresh ();
grub_abort (); grub_fatal ("gcrypt bug");
} }
gcry_err_code_t gcry_err_code_t

View file

@ -375,7 +375,6 @@ char *EXPORT_FUNC(grub_xasprintf) (const char *fmt, ...)
__attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT; __attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT;
char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args) WARN_UNUSED_RESULT; char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args) WARN_UNUSED_RESULT;
void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn));
void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn));
grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,
grub_uint64_t d, grub_uint64_t d,
grub_uint64_t *r); grub_uint64_t *r);