From 3e42f8c0a91e1cc1d2251a33fbf2525ed2dead45 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 20 Jun 2011 12:24:38 +0100 Subject: gconfd: Add ifdef blocks around the CORBA code --- gconf/gconfd.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- gconf/gconfd.h | 6 ++++++ 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/gconf/gconfd.c b/gconf/gconfd.c index c0fcddf9..c3697e22 100644 --- a/gconf/gconfd.c +++ b/gconf/gconfd.c @@ -35,9 +35,12 @@ #include "gconf.h" #include "gconfd.h" #include "gconf-database.h" + +#ifdef HAVE_CORBA #include #include "GConfX.h" +#endif #include #include @@ -123,6 +126,7 @@ safe_g_hash_table_insert(GHashTable* ht, gpointer key, gpointer value) static void gconf_main (void); static gboolean gconf_main_is_running (void); +#ifdef HAVE_CORBA static void logfile_save (void); static void logfile_read (void); static void log_client_add (const ConfigListener client); @@ -134,6 +138,7 @@ static GSList *list_clients (void); static void log_clients_to_string (GString *str); static void drop_old_clients (void); static guint client_count (void); +#endif static void enter_shutdown (void); @@ -161,6 +166,7 @@ static gboolean in_shutdown = FALSE; */ static gboolean need_db_reload = FALSE; +#ifdef HAVE_CORBA /* * CORBA goo */ @@ -334,6 +340,7 @@ gconfd_shutdown(PortableServer_Servant servant, CORBA_Environment *ev) gconfd_main_quit(); } +#endif /* HAVE_CORBA */ /* * Main code @@ -509,12 +516,15 @@ signal_handler (int signo) } } +#ifdef HAVE_CORBA PortableServer_POA gconf_get_poa (void) { return the_poa; } +#endif +#ifdef HAVE_CORBA static const char * get_introspection_xml (void) { @@ -632,6 +642,7 @@ get_on_d_bus (void) return connection; } +#endif #ifdef ENABLE_DEFAULTS_SERVICE /* listen on system bus for defaults changes */ @@ -749,14 +760,17 @@ main(int argc, char** argv) sigset_t empty_mask; sigset_t full_mask; #endif + +#ifdef HAVE_CORBA CORBA_Environment ev; CORBA_ORB orb; gchar* ior; - int exit_code = 0; - GError *err; + DBusConnection *connection; +#endif + int dev_null_fd; + int exit_code = 0; int write_byte_fd; - DBusConnection *connection; _gconf_init_i18n (); setlocale (LC_ALL, ""); @@ -868,10 +882,14 @@ main(int argc, char** argv) #endif #endif +#ifdef HAVE_CORBA CORBA_exception_init(&ev); +#endif init_databases (); + +#ifdef HAVE_CORBA orb = gconf_orb_get (); POA_ConfigServer2__init (&poa_server_servant, &ev); @@ -904,7 +922,10 @@ main(int argc, char** argv) */ gconf_server_load_sources (); } - +#endif + + +#ifdef HAVE_CORBA /* notify caller that we're done either getting the lock * or not getting it */ @@ -929,7 +950,8 @@ main(int argc, char** argv) /* Read saved log file, if any */ logfile_read (); - +#endif + #ifdef ENABLE_DEFAULTS_SERVICE get_on_system_bus (); #endif @@ -944,17 +966,22 @@ main(int argc, char** argv) */ enter_shutdown (); +#ifdef HAVE_CORBA /* Save current state in logfile (may compress the logfile a good * bit) */ logfile_save (); +#endif shutdown_databases (); gconfd_locale_cache_drop (); +#ifdef HAVE_CORBA if (daemon_lock) { + GError *err; + err = NULL; gconf_release_lock (daemon_lock, &err); if (err != NULL) @@ -966,6 +993,7 @@ main(int argc, char** argv) } daemon_lock = NULL; +#endif gconf_log (GCL_DEBUG, _("Exiting")); @@ -988,16 +1016,22 @@ periodic_cleanup_timeout(gpointer data) gconf_log (GCL_INFO, _("SIGHUP received, reloading all databases")); need_db_reload = FALSE; +#ifdef HAVE_CORBA logfile_save (); +#endif shutdown_databases (); init_databases (); gconf_server_load_sources (); +#ifdef HAVE_CORBA logfile_read (); +#endif } gconf_log (GCL_DEBUG, "Performing periodic cleanup, expiring cache cruft"); +#ifdef HAVE_CORBA drop_old_clients (); +#endif drop_old_databases (); if (no_databases_in_use () && client_count () == 0) @@ -1010,6 +1044,7 @@ periodic_cleanup_timeout(gpointer data) /* expire old locale cache entries */ gconfd_locale_cache_expire (); +#ifdef HAVE_CORBA if (!need_log_cleanup) { gconf_log (GCL_DEBUG, "No log file saving needed in periodic cleanup handler"); @@ -1311,7 +1346,9 @@ gconfd_notify_other_listeners (GConfDatabase *modified_db, if (gconf_sources_is_affected (db->sources, modified_source, key)) { GConfValue *value; +#ifdef HAVE_CORBA ConfigValue *cvalue; +#endif GError *error; gboolean is_default; gboolean is_writable; @@ -1334,6 +1371,7 @@ gconfd_notify_other_listeners (GConfDatabase *modified_db, return; } +#if HAVE_CORBA if (value != NULL) { cvalue = gconf_corba_value_from_gconf_value (value); @@ -1352,6 +1390,7 @@ gconfd_notify_other_listeners (GConfDatabase *modified_db, is_writable, FALSE); CORBA_free (cvalue); +#endif } tmp2 = tmp2->next; @@ -1389,6 +1428,7 @@ enter_shutdown(void) } +#ifdef HAVE_CORBA /* Exceptions */ gboolean @@ -2706,6 +2746,7 @@ client_count (void) else return g_hash_table_size (client_table); } +#endif gboolean gconfd_in_shutdown (void) diff --git a/gconf/gconfd.h b/gconf/gconfd.h index ac9716ad..aa3123c4 100644 --- a/gconf/gconfd.h +++ b/gconf/gconfd.h @@ -25,9 +25,14 @@ G_BEGIN_DECLS #include "gconf-error.h" + +#ifdef HAVE_CORBA #include "GConfX.h" +#endif + #include "gconf-database.h" +#ifdef HAVE_CORBA PortableServer_POA gconf_get_poa (void); /* return TRUE if the exception was set, clear err if needed */ @@ -41,6 +46,7 @@ gboolean gconfd_logfile_change_listener (GConfDatabase *db, GError **err); gboolean gconfd_check_in_shutdown (CORBA_Environment *ev); +#endif void gconfd_notify_other_listeners (GConfDatabase *modified_db, GConfSources *modified_sources, -- cgit v1.2.1