[mednaffe] 23/99: Show a message error when mednafen does not return 0

Stephen Kitt skitt at moszumanska.debian.org
Tue Aug 2 21:00:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

skitt pushed a commit to branch master
in repository mednaffe.

commit 91aaaaa2e5b88f690402f5da2a334340038c6abe
Author: amatcoder at gmail.com <amatcoder at gmail.com@44025b82-9115-564b-7d03-7f3fc60b4744>
Date:   Wed Nov 27 16:09:38 2013 +0000

    Show a message error when mednafen does not return 0
---
 src/command.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/command.c b/src/command.c
index 8e15219..88168df 100644
--- a/src/command.c
+++ b/src/command.c
@@ -24,7 +24,6 @@
 
 #ifdef G_OS_WIN32
   #include <windows.h>
-  #include <io.h>
 #endif
 
 #ifdef G_OS_WIN32
@@ -94,7 +93,27 @@ gchar **build_command(guidata *gui)
 void child_watch(GPid pid, gint status, guidata *gui)
 {
   gpointer name;
-
+  
+  #ifdef G_OS_WIN32
+    DWORD lpExitCode=0;
+  
+    GetExitCodeProcess( pid, &lpExitCode);
+    if (lpExitCode!=0)
+    {
+	  GtkWidget *dialog;
+	  
+      dialog = gtk_message_dialog_new (GTK_WINDOW(gui->topwindow),
+                                       GTK_DIALOG_DESTROY_WITH_PARENT,
+                                       GTK_MESSAGE_ERROR,
+                                       GTK_BUTTONS_CLOSE,
+                       "Mednafen error.\nRead stdout.txt for details.");
+                       
+      gtk_dialog_run (GTK_DIALOG (dialog));
+      gtk_widget_destroy (dialog);
+      printf ("[Mednaffe] Mednafen error. Read stdout.txt for details.");
+    }
+  #endif
+  
   g_spawn_close_pid( pid );
   gui->executing = FALSE;
 
@@ -148,6 +167,7 @@ void row_exec(GtkTreeView *treeview, GtkTreePath *patho,
   ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
   
   gui->command = build_command_win(gui);
+  printf ("[Mednaffe] Executing mednafen:\n\n");
   ret = CreateProcess(NULL, gui->command, NULL, NULL, FALSE, 0, 
                       NULL, NULL, &si, &pi); 
   if (!ret) 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mednaffe.git



More information about the Pkg-games-commits mailing list