aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-18 23:55:12 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-18 23:58:19 +0800
commit461f022eb7fae7147845797c0544304ae35c7e8b (patch)
treea734d25c483a14a36973f9d62f44654782b1be7a /shell/main.c
parent12d1810be39661750956ec1e041f7f572ea86698 (diff)
downloadgsoc2013-evolution-461f022eb7fae7147845797c0544304ae35c7e8b.tar.gz
gsoc2013-evolution-461f022eb7fae7147845797c0544304ae35c7e8b.tar.zst
gsoc2013-evolution-461f022eb7fae7147845797c0544304ae35c7e8b.zip
Kill the killev program, and the whole tools directory.
The --force-shutdown option now simply runs "pkill evolution".
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/shell/main.c b/shell/main.c
index a74e28ace5..7ce930f6c2 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -329,7 +329,7 @@ static GOptionEntry entries[] = {
N_("Start in online mode"), NULL },
#ifdef KILL_PROCESS_CMD
{ "force-shutdown", '\0', 0, G_OPTION_ARG_NONE, &force_shutdown,
- N_("Forcibly shut down all Evolution components"), NULL },
+ N_("Forcibly shut down Evolution"), NULL },
#endif
#ifdef DEVELOPMENT
{ "force-migrate", '\0', 0, G_OPTION_ARG_NONE, &force_migrate,
@@ -392,6 +392,33 @@ set_paths (void)
}
#endif
+static void G_GNUC_NORETURN
+shell_force_shutdown (void)
+{
+ gchar *program;
+
+ /* This is not as destructive as it was in the Bonobo era.
+ * The Evolution-Data-Server D-Bus services should not be killed
+ * because other programs may be using them. The alarm daemon is
+ * an autostart program now and Evolution no longer spawns it, so
+ * that should not be killed either. The only thing left to do
+ * really is shoot ourselves. */
+
+ /* XXX Maybe --force-shutdown should be deprecated. */
+
+ program = g_find_program_in_path ("pkill");
+
+ if (program == NULL) {
+ g_printerr ("Could not find `pkill' program in path.\n");
+ exit (1);
+ }
+
+ /* This does not return. */
+ execl (program, "pkill", "evolution", NULL);
+
+ g_assert_not_reached ();
+}
+
static void
shell_window_destroyed_cb (EShell *shell)
{
@@ -475,7 +502,6 @@ main (gint argc, gchar **argv)
#ifdef DEVELOPMENT
gboolean skip_warning_dialog;
#endif
- gchar *filename;
GError *error = NULL;
/* Make ElectricFence work. */
@@ -520,13 +546,8 @@ main (gint argc, gchar **argv)
exit (1);
}
- if (force_shutdown) {
- filename = g_build_filename (
- EVOLUTION_TOOLSDIR, "killev", NULL);
- execl (filename, "killev", NULL);
- /* Not reached */
- exit (0);
- }
+ if (force_shutdown)
+ shell_force_shutdown ();
client = gconf_client_get_default ();