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



commit 5cda158b448fb7a60a9220582af22fb4315b109d
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
    
    (cherry picked from commit 5f0e2c255b0cb0e135dec0ec0f4fb293b4f84a42)

 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 451f475..9335a56 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -908,7 +908,10 @@ do_export (const char *path, NMConnection *connection, GError **error)
 
        f = fopen (path, "w");
        if (!f) {
-               g_set_error (error, 0, 0, "could not open file for writing");
+               g_set_error_literal (error,
+                                    OPENVPN_PLUGIN_UI_ERROR,
+                                    OPENVPN_PLUGIN_UI_ERROR_FILE_NOT_OPENVPN,
+                                    _("could not open file for writing"));
                return FALSE;
        }
 
@@ -916,7 +919,10 @@ do_export (const char *path, NMConnection *connection, GError **error)
        if (value && strlen (value))
                gateways = value;
        else {
-               g_set_error (error, 0, 0, "connection was incomplete (missing gateway)");
+               g_set_error_literal (error,
+                                    OPENVPN_PLUGIN_UI_ERROR,
+                                    OPENVPN_PLUGIN_UI_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]