[gedit] Improve error reporting when failing to load private lib



commit 89a68722290274db6e6bd9119c1c1cdc7eecc22b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Mar 25 11:43:23 2015 +0100

    Improve error reporting when failing to load private lib

 gedit/gedit.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit.c b/gedit/gedit.c
index 130b386..6c330c2 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -67,13 +67,25 @@ gedit_w32_load_private_dll (void)
                 */
                dllpath = g_build_filename (prefix, "lib", "gedit", "libgedit.dll", NULL);
                g_free (prefix);
+
                libgedit_dll = g_module_open (dllpath, 0);
+               if (libgedit_dll == NULL)
+               {
+                       g_printerr ("Failed to load '%s': %s\n",
+                                   dllpath, g_module_error ());
+               }
+
                g_free (dllpath);
        }
 
        if (libgedit_dll == NULL)
        {
                libgedit_dll = g_module_open ("libgedit.dll", 0);
+               if (libgedit_dll == NULL)
+               {
+                       g_printerr ("Failed to load 'libgedit.dll': %s\n",
+                                   g_module_error ());
+               }
        }
 
        return (libgedit_dll != NULL);
@@ -104,7 +116,6 @@ main (int argc, char *argv[])
 #ifdef G_OS_WIN32
        if (!gedit_w32_load_private_dll ())
        {
-               g_printerr ("Failed to load libgedit DLL\n");
                return 1;
        }
 


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