From 461f022eb7fae7147845797c0544304ae35c7e8b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Sep 2009 11:55:12 -0400 Subject: Kill the killev program, and the whole tools directory. The --force-shutdown option now simply runs "pkill evolution". --- shell/Makefile.am | 3 +-- shell/main.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/Makefile.am b/shell/Makefile.am index 7358a1466b..edc143ee31 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/widgets/misc \ -I$(top_srcdir) \ -I$(top_srcdir)/shell \ - -I$(top_builddir)/shell \ + -DEVOLUTION_BINDIR=\""$(bindir)"\" \ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ @@ -18,7 +18,6 @@ AM_CPPFLAGS = \ -DEVOLUTION_MODULEDIR=\""$(moduledir)"\" \ -DEVOLUTION_RULEDIR=\""$(privdatadir)"\" \ -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \ - -DEVOLUTION_TOOLSDIR=\""$(privlibexecdir)"\" \ -DPREFIX=\""$(prefix)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DDATADIR=\""$(datadir)"\" \ 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 (); -- cgit