[metacity] main: remove MetaExitCode enum
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] main: remove MetaExitCode enum
- Date: Fri, 10 Mar 2017 20:22:06 +0000 (UTC)
commit 7f0d494efd807879fc52896579b1971ba3c36117
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Mar 10 14:36:04 2017 +0200
main: remove MetaExitCode enum
src/core/display.c | 2 +-
src/core/main.c | 17 +++++------------
src/core/session.c | 5 ++---
src/include/main.h | 8 +-------
4 files changed, 9 insertions(+), 23 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 69b4b29..0fe78b8 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -876,7 +876,7 @@ meta_display_close (MetaDisplay *display,
g_free (display);
the_display = NULL;
- meta_quit (META_EXIT_SUCCESS);
+ meta_quit ();
}
MetaScreen*
diff --git a/src/core/main.c b/src/core/main.c
index add1486..6998b53 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -68,11 +68,6 @@
#include <unistd.h>
/**
- * The exit code we'll return to our parent process when we eventually die.
- */
-static MetaExitCode meta_exit_code = META_EXIT_SUCCESS;
-
-/**
* Handle on the main loop, so that we have an easy way of shutting Metacity
* down.
*/
@@ -344,7 +339,7 @@ sigterm_handler (int signum)
static gboolean
on_sigterm (void)
{
- meta_quit (META_EXIT_SUCCESS);
+ meta_quit ();
return FALSE;
}
@@ -506,11 +501,11 @@ main (int argc, char **argv)
g_critical ("Failed to restart: %s", err->message);
g_error_free (err);
- meta_exit_code = META_EXIT_ERROR;
+ return EXIT_FAILURE;
}
}
- return meta_exit_code;
+ return EXIT_SUCCESS;
}
/**
@@ -523,10 +518,8 @@ main (int argc, char **argv)
* \param code The success or failure code to return to the calling process.
*/
void
-meta_quit (MetaExitCode code)
+meta_quit (void)
{
- meta_exit_code = code;
-
if (g_main_loop_is_running (meta_main_loop))
g_main_loop_quit (meta_main_loop);
}
@@ -541,7 +534,7 @@ void
meta_restart (void)
{
meta_restart_after_quit = TRUE;
- meta_quit (META_EXIT_SUCCESS);
+ meta_quit ();
}
/**
diff --git a/src/core/session.c b/src/core/session.c
index c6fa31f..95d44a4 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -110,7 +110,7 @@ process_ice_messages (GIOChannel *channel,
* being cleaned up, since it is owned by libSM.
*/
disconnect ();
- meta_quit (META_EXIT_SUCCESS);
+ meta_quit ();
return FALSE;
}
@@ -538,13 +538,12 @@ save_yourself_callback (SmcConn smc_conn,
save_yourself_possibly_done (shutdown, successful);
}
-
static void
die_callback (SmcConn smc_conn, SmPointer client_data)
{
meta_topic (META_DEBUG_SM, "Exiting at request of session manager\n");
disconnect ();
- meta_quit (META_EXIT_SUCCESS);
+ meta_quit ();
}
static void
diff --git a/src/include/main.h b/src/include/main.h
index 8fdf113..9f68795 100644
--- a/src/include/main.h
+++ b/src/include/main.h
@@ -24,14 +24,8 @@
#include <glib.h>
-typedef enum
-{
- META_EXIT_SUCCESS,
- META_EXIT_ERROR
-} MetaExitCode;
-
/* g_main_loop_quit() then fall out of main() */
-void meta_quit (MetaExitCode code);
+void meta_quit (void);
void meta_restart (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]