[network-manager-openvpn/lr/multiple-vpn: 5/7] service: add missing error handling
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openvpn/lr/multiple-vpn: 5/7] service: add missing error handling
- Date: Tue, 3 Nov 2015 14:53:00 +0000 (UTC)
commit b1944dfd234520863bec4564952b21db1034f896
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Fri Aug 21 17:14:03 2015 +0200
service: add missing error handling
src/nm-openvpn-service.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 6efb592..8b5250d 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -1820,6 +1820,7 @@ main (int argc, char *argv[])
gboolean persist = FALSE;
GOptionContext *opt_ctx = NULL;
gchar *bus_name = NM_DBUS_SERVICE_OPENVPN;
+ GError *error = NULL;
GOptionEntry options[] = {
{ "persist", 0, 0, G_OPTION_ARG_NONE, &persist, N_("Don't quit when VPN connection
terminates"), NULL },
@@ -1850,7 +1851,12 @@ main (int argc, char *argv[])
_("nm-openvpn-service provides integrated "
"OpenVPN capability to NetworkManager."));
- g_option_context_parse (opt_ctx, &argc, &argv, NULL);
+ if (!g_option_context_parse (opt_ctx, &argc, &argv, &error)) {
+ g_warning ("Error parsing the command line options: %s", error->message);
+ g_option_context_free (opt_ctx);
+ g_clear_error (&error);
+ exit (1);
+ }
g_option_context_free (opt_ctx);
if (getenv ("OPENVPN_DEBUG"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]