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