Better fix for converting to Unix process exit codes.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 28 May 2004 09:54:19 +0000
changeset 36 9e60553d82bc
parent 35 9e711121a59f
child 37 d3a5c9ddba91
Better fix for converting to Unix process exit codes.
Makefile
mojopatch.c
platform.h
platform_unix.c
--- a/Makefile	Fri May 28 09:53:00 2004 +0000
+++ b/Makefile	Fri May 28 09:54:19 2004 +0000
@@ -24,7 +24,7 @@
 PLATFORMSRCS := platform_unix.c ui_stdio.c
 endif
 
-CFLAGS := $(PLATFORMDEF) -Wall -g -fsigned-char -fno-omit-frame-pointer -Os
+CFLAGS := $(PLATFORMDEF) -Wall -g -fsigned-char -fno-omit-frame-pointer -O0
 
 
 MOJOPATCHSRCS := mojopatch.c md5.c $(PLATFORMSRCS)
--- a/mojopatch.c	Fri May 28 09:53:00 2004 +0000
+++ b/mojopatch.c	Fri May 28 09:54:19 2004 +0000
@@ -39,8 +39,6 @@
 
 #define DEFAULT_PATCHFILENAME "default.mojopatch"
 
-#define PATCHERROR    0
-#define PATCHSUCCESS  1
 #define MOJOPATCHSIG "mojopatch " VERSION " (icculus@clutteredmind.org)\r\n"
 
 #define STATIC_STRING_SIZE 1024
@@ -2173,7 +2171,7 @@
     _dlog("(Total running time: %ld seconds.)", time(NULL) - starttime);
 
     ui_deinit();
-    return((retval == PATCHSUCCESS) ? 0 : 1);
+    return(retval);
 } /* mojopatch_main */
 
 /* end of mojopatch.c ... */
--- a/platform.h	Fri May 28 09:53:00 2004 +0000
+++ b/platform.h	Fri May 28 09:54:19 2004 +0000
@@ -6,6 +6,9 @@
 extern "C" {
 #endif
 
+#define PATCHERROR    0
+#define PATCHSUCCESS  1
+
 #if PLATFORM_WIN32
 #  include <io.h>
 #  define PATH_SEP "\\"
--- a/platform_unix.c	Fri May 28 09:53:00 2004 +0000
+++ b/platform_unix.c	Fri May 28 09:54:19 2004 +0000
@@ -609,7 +609,7 @@
     find_basedir(&argc, argv);
     retval = mojopatch_main(argc, argv);
     free(basedir);
-    return(retval);
+    return((retval == PATCHSUCCESS) ? 0 : 1);
 } /* unixmain */
 
 /* end of platform_unix.c ... */