[easytag/wip/mingw-2.1.9alpha1] Use g_win32_error_message() with	GetLastError()
- From: David King <davidk src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [easytag/wip/mingw-2.1.9alpha1] Use g_win32_error_message() with	GetLastError()
 
- Date: Wed, 23 Oct 2013 20:59:07 +0000 (UTC)
 
commit 50688034ae5e2872f67ca3cc859aada487f8ce89
Author: David King <amigadave amigadave com>
Date:   Wed Oct 23 21:57:23 2013 +0100
    Use g_win32_error_message() with GetLastError()
 src/browser.c |    8 ++++++--
 src/misc.c    |   11 ++++++++---
 2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index 9f5b484..d511111 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -4306,8 +4306,12 @@ Run_Program (const gchar *program_name, GList *args_list)
                       &siStartupInfo,
                       &piProcessInfo) == FALSE)
     {
-        Log_Print (LOG_ERROR, _("Cannot execute %s (error %d)\n"),
-                   program_name, (guint32)GetLastError ());
+        gchar *error;
+
+        error = g_win32_error_message (GetLastError ());
+        Log_Print (LOG_ERROR, _("Cannot execute ‘%s’ (%s)"), program_name,
+                   error);
+        g_free (error);
     }
 
     // Free allocated parameters (for each filename)
diff --git a/src/misc.c b/src/misc.c
index e94638d..829d123 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -833,8 +833,12 @@ Run_Audio_Player_Using_File_List (GList *etfilelist)
                       &siStartupInfo,
                       &piProcessInfo) == FALSE)
     {
-        Log_Print (LOG_ERROR, _("Cannot execute %s (error %d)\n"),
-                   AUDIO_FILE_PLAYER, (guint32)GetLastError ());
+        gchar *error;
+
+        error = g_win32_error_message (GetLastError ());
+        Log_Print (LOG_ERROR, _("Cannot execute ‘%s’ (%s)"), AUDIO_FILE_PLAYER,
+                   error);
+        g_free (error);
     }
 
     // Free allocated parameters (for each filename)
@@ -879,7 +883,8 @@ Run_Audio_Player_Using_File_List (GList *etfilelist)
         {
             if (execvp(argv[0],argv) == -1)
             {
-                Log_Print(LOG_ERROR,_("Cannot execute %s (%s)"),argv[0],g_strerror(errno));
+                Log_Print (LOG_ERROR, _("Cannot execute ‘%s’ (%s)"), argv[0],
+                           g_strerror (errno));
             }
             g_strfreev(argv_user);
             _exit(1);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]