Skip to content

Commit

Permalink
Better fix for converting to Unix process exit codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 28, 2004
1 parent d583a6a commit 24748c6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions mojopatch.c
Expand Up @@ -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
Expand Down Expand Up @@ -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 ... */
Expand Down
3 changes: 3 additions & 0 deletions platform.h
Expand Up @@ -6,6 +6,9 @@
extern "C" {
#endif

#define PATCHERROR 0
#define PATCHSUCCESS 1

#if PLATFORM_WIN32
# include <io.h>
# define PATH_SEP "\\"
Expand Down
2 changes: 1 addition & 1 deletion platform_unix.c
Expand Up @@ -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 ... */
Expand Down

0 comments on commit 24748c6

Please sign in to comment.