[network-manager-openswan/lr/libnm: 8/10] fixup! service: port to libnm
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openswan/lr/libnm: 8/10] fixup! service: port to libnm
- Date: Sat, 15 Aug 2015 23:07:42 +0000 (UTC)
commit 3b89a7991947471bd77df1742eb1c12c269810d3
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Fri Aug 14 18:06:29 2015 +0200
fixup! service: port to libnm
Initialize a GInitable.
src/nm-openswan-service.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/nm-openswan-service.c b/src/nm-openswan-service.c
index 3303ecb..d8e28c1 100644
--- a/src/nm-openswan-service.c
+++ b/src/nm-openswan-service.c
@@ -1294,6 +1294,7 @@ main (int argc, char *argv[])
NMOpenSwanPlugin *plugin;
gboolean persist = FALSE;
GOptionContext *opt_ctx = NULL;
+ GError *error = NULL;
GOptionEntry options[] = {
{ "persist", 0, 0, G_OPTION_ARG_NONE, &persist, N_("Don't quit when VPN connection
terminates"), NULL },
@@ -1331,11 +1332,14 @@ main (int argc, char *argv[])
if (debug)
g_message ("%s (version " DIST_VERSION ") starting...", argv[0]);
- plugin = g_object_new (NM_TYPE_OPENSWAN_PLUGIN,
- NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME, NM_DBUS_SERVICE_OPENSWAN,
- NULL);
- if (!plugin)
+ plugin = g_initable_new (NM_TYPE_OPENSWAN_PLUGIN, NULL, &error,
+ NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME, NM_DBUS_SERVICE_OPENSWAN,
+ NULL);
+ if (!plugin) {
+ g_warning ("Failed to initialize a plugin instance: %s", error->message);
+ g_error_free (error);
exit (1);
+ }
loop = g_main_loop_new (NULL, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]