[network-manager-openswan/jk/openswan-plugin-init] core: NMVPNPlugin initialization changed to use GInitable (rh #1050934)



commit dd7122b585d41b39c840c78a176dbe89f4617b09
Author: Jiří Klimeš <jklimes redhat com>
Date:   Tue Mar 18 12:11:18 2014 +0100

    core: NMVPNPlugin initialization changed to use GInitable (rh #1050934)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1050934

 configure.ac              |    2 +-
 src/nm-openswan-service.c |   18 ++++++++++++++----
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 911b1ad..265dc0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
 IT_PROG_INTLTOOL([0.35])
 AM_GLIB_GNU_GETTEXT
 
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32)
+PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.32)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index 8f8f039..488ee59 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -15,7 +15,7 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Copyright (C) 2010 - 2011 Red Hat, Inc.
+ * Copyright (C) 2010 - 2014 Red Hat, Inc.
  */
 
 #include <config.h>
@@ -31,6 +31,7 @@
 #include <locale.h>
 
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 
 #include <nm-setting-vpn.h>
 #include "nm-openswan-service.h"
@@ -803,9 +804,18 @@ nm_openswan_plugin_class_init (NMOPENSWANPluginClass *openswan_class)
 NMOPENSWANPlugin *
 nm_openswan_plugin_new (void)
 {
-       return (NMOPENSWANPlugin *) g_object_new (NM_TYPE_OPENSWAN_PLUGIN,
-                                                                  NM_VPN_PLUGIN_DBUS_SERVICE_NAME, 
NM_DBUS_SERVICE_OPENSWAN,
-                                                                  NULL);
+       NMOPENSWANPlugin *plugin;
+       GError *error = NULL;
+
+       plugin = g_initable_new (NM_TYPE_OPENSWAN_PLUGIN, NULL, &error,
+                                NM_VPN_PLUGIN_DBUS_SERVICE_NAME, NM_DBUS_SERVICE_OPENSWAN,
+                                NULL);
+       if (!plugin) {
+               g_warning ("%s", error->message);
+               g_error_free (error);
+       }
+
+       return plugin;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]