about summary refs log tree commit diff
path: root/examples/C/glib/monitor-nm-running-GDBus.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/C/glib/monitor-nm-running-GDBus.c')
-rw-r--r--examples/C/glib/monitor-nm-running-GDBus.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/C/glib/monitor-nm-running-GDBus.c b/examples/C/glib/monitor-nm-running-GDBus.c
index 42f9b758..9e38d4c7 100644
--- a/examples/C/glib/monitor-nm-running-GDBus.c
+++ b/examples/C/glib/monitor-nm-running-GDBus.c
@@ -31,7 +31,6 @@
 
 #include <gio/gio.h>
 
-#if GLIB_CHECK_VERSION(2,26,0)
 static void
 on_name_appeared (GDBusConnection *connection,
                   const gchar     *name,
@@ -49,19 +48,19 @@ on_name_vanished (GDBusConnection *connection,
 {
 	g_print ("Name '%s' does not exist on the system bus => NM is not running\n", name);
 }
-#endif
 
 
 int
 main (int argc, char *argv[])
 {
-#if GLIB_CHECK_VERSION(2,26,0)
 	guint watcher_id;
 	GMainLoop *loop;
 	GBusNameWatcherFlags flags;
 
+#if !GLIB_CHECK_VERSION (2, 35, 0)
 	/* Initialize GType system */
 	g_type_init ();
+#endif
 
 	g_print ("Monitor 'org.freedesktop.NetworkManager' D-Bus name\n");
 	g_print ("===================================================\n");
@@ -83,9 +82,6 @@ main (int argc, char *argv[])
 
 	/* Stop watching the name */
 	g_bus_unwatch_name (watcher_id);
-#else
-	g_print ("Sorry, you need at least GLib 2.26 for GDBus.\n");
-#endif
 
 	return 0;
 }