Blame SOURCES/0083-Make-exit-take-a-return-code.patch

d9d99f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d9d99f
From: Peter Jones <pjones@redhat.com>
d9d99f
Date: Wed, 26 Feb 2014 21:49:12 -0500
d9d99f
Subject: [PATCH] Make "exit" take a return code.
d9d99f
d9d99f
This adds "exit" with a return code.  With this patch, any "exit"
d9d99f
command /may/ include a return code, and on platforms that support
d9d99f
returning with an exit status, we will do so.  By default we return the
d9d99f
same exit status we did before this patch.
d9d99f
d9d99f
Signed-off-by: Peter Jones <pjones@redhat.com>
d9d99f
---
d9d99f
 grub-core/kern/emu/main.c | 6 ++++++
d9d99f
 grub-core/kern/misc.c     | 9 +++++++++
d9d99f
 2 files changed, 15 insertions(+)
d9d99f
d9d99f
diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c
d9d99f
index 55ea5a11ccd..7e47ec81263 100644
d9d99f
--- a/grub-core/kern/emu/main.c
d9d99f
+++ b/grub-core/kern/emu/main.c
d9d99f
@@ -72,6 +72,12 @@ grub_exit (int retval __attribute__((unused)))
d9d99f
   grub_reboot ();
d9d99f
 }
d9d99f
 
d9d99f
+void
d9d99f
+grub_exit (int retval __attribute__((unused)))
d9d99f
+{
d9d99f
+  grub_reboot ();
d9d99f
+}
d9d99f
+
d9d99f
 void
d9d99f
 grub_machine_init (void)
d9d99f
 {
d9d99f
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
d9d99f
index 5ce89a40c68..04371ac49f2 100644
d9d99f
--- a/grub-core/kern/misc.c
d9d99f
+++ b/grub-core/kern/misc.c
d9d99f
@@ -1120,6 +1120,15 @@ grub_abort (void)
d9d99f
   grub_exit (1);
d9d99f
 }
d9d99f
 
d9d99f
+#if defined (__clang__) && !defined (GRUB_UTIL)
d9d99f
+/* clang emits references to abort().  */
d9d99f
+void __attribute__ ((noreturn))
d9d99f
+abort (void)
d9d99f
+{
d9d99f
+  grub_abort ();
d9d99f
+}
d9d99f
+#endif
d9d99f
+
d9d99f
 void
d9d99f
 grub_fatal (const char *fmt, ...)
d9d99f
 {