From 24748c6498c62fc27feb8b7588d4b306cfc5eef1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 28 May 2004 09:54:19 +0000 Subject: [PATCH] Better fix for converting to Unix process exit codes. --- Makefile | 2 +- mojopatch.c | 4 +--- platform.h | 3 +++ platform_unix.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 9f6fafc..0fab36f 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ PLATFORMDEF := -DPLATFORM_UNIX 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) diff --git a/mojopatch.c b/mojopatch.c index 2536b3c..d7bfddc 100644 --- a/mojopatch.c +++ b/mojopatch.c @@ -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 @@ int mojopatch_main(int argc, char **argv) _dlog("(Total running time: %ld seconds.)", time(NULL) - starttime); ui_deinit(); - return((retval == PATCHSUCCESS) ? 0 : 1); + return(retval); } /* mojopatch_main */ /* end of mojopatch.c ... */ diff --git a/platform.h b/platform.h index 6a7982b..e5e27c9 100644 --- a/platform.h +++ b/platform.h @@ -6,6 +6,9 @@ extern "C" { #endif +#define PATCHERROR 0 +#define PATCHSUCCESS 1 + #if PLATFORM_WIN32 # include # define PATH_SEP "\\" diff --git a/platform_unix.c b/platform_unix.c index 04f162e..23ed1cf 100644 --- a/platform_unix.c +++ b/platform_unix.c @@ -609,7 +609,7 @@ int main(int argc, char **argv) find_basedir(&argc, argv); retval = mojopatch_main(argc, argv); free(basedir); - return(retval); + return((retval == PATCHSUCCESS) ? 0 : 1); } /* unixmain */ /* end of platform_unix.c ... */