[network-manager-openvpn] export: use an error quark for domain in g_set_error_literal() instead of 0



commit 5f0e2c255b0cb0e135dec0ec0f4fb293b4f84a42
Author: Jiří Klimeš <jklimes redhat com>
Date:   Tue Nov 24 12:09:30 2015 +0100

    export: use an error quark for domain in g_set_error_literal() instead of 0
    
    (process:19145): GLib-CRITICAL **: g_error_new_literal: assertion 'domain != 0' failed

 properties/import-export.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index 6afea22..ceccae2 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -1055,7 +1055,10 @@ do_export (const char *path, NMConnection *connection, GError **error)
 
        f = fopen (path, "w");
        if (!f) {
-               g_set_error_literal (error, 0, 0, _("could not open file for writing"));
+               g_set_error_literal (error,
+                                    OPENVPN_EDITOR_PLUGIN_ERROR,
+                                    OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN,
+                                    _("could not open file for writing"));
                return FALSE;
        }
 
@@ -1063,7 +1066,10 @@ do_export (const char *path, NMConnection *connection, GError **error)
        if (value && strlen (value))
                gateways = value;
        else {
-               g_set_error_literal (error, 0, 0, _("connection was incomplete (missing gateway)"));
+               g_set_error_literal (error,
+                                    OPENVPN_EDITOR_PLUGIN_ERROR,
+                                    OPENVPN_EDITOR_PLUGIN_ERROR_FILE_NOT_OPENVPN,
+                                    _("connection was incomplete (missing gateway)"));
                goto done;
        }
 


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