grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix compilation of utilities


From: Pavel Roskin
Subject: [PATCH] Fix compilation of utilities
Date: Wed, 01 Jul 2009 11:34:29 -0400
User-agent: StGIT/0.14.3

ChangeLog:

        * util/misc.c: Move grub_reboot() and grub_halt() ...
        * util/grub-emu.c: ... here.  Make main_env static.
        * include/grub/util/misc.h: Remove main_env.
---

 include/grub/util/misc.h |    1 -
 util/grub-emu.c          |   18 +++++++++++++++++-
 util/misc.c              |   16 ----------------
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h
index af7cb2d..6a93ab0 100644
--- a/include/grub/util/misc.h
+++ b/include/grub/util/misc.h
@@ -38,7 +38,6 @@
 
 extern char *progname;
 extern int verbosity;
-extern jmp_buf main_env;
 
 void grub_util_warn (const char *fmt, ...);
 void grub_util_info (const char *fmt, ...);
diff --git a/util/grub-emu.c b/util/grub-emu.c
index c133dbe..31365f3 100644
--- a/util/grub-emu.c
+++ b/util/grub-emu.c
@@ -40,7 +40,7 @@
 #include <grub_emu_init.h>
 
 /* Used for going back to the main function.  */
-jmp_buf main_env;
+static jmp_buf main_env;
 
 /* Store the prefix specified by an argument.  */
 static char *prefix = 0;
@@ -69,6 +69,22 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
 }
 
 void
+grub_reboot (void)
+{
+  longjmp (main_env, 1);
+}
+
+void
+grub_halt (
+#ifdef GRUB_MACHINE_PCBIOS
+          int no_apm __attribute__ ((unused))
+#endif
+          )
+{
+  grub_reboot ();
+}
+
+void
 grub_machine_init (void)
 {
 }
diff --git a/util/misc.c b/util/misc.c
index 2d00390..f615a42 100644
--- a/util/misc.c
+++ b/util/misc.c
@@ -439,19 +439,3 @@ fail:
 }
 
 #endif /* __MINGW32__ */
-
-void
-grub_reboot (void)
-{
-  longjmp (main_env, 1);
-}
-
-void
-grub_halt (
-#ifdef GRUB_MACHINE_PCBIOS
-          int no_apm __attribute__ ((unused))
-#endif
-          )
-{
-  grub_reboot ();
-}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]