From ebe5a642a1ba3d3a52976b335faaaff6860a85b1 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 14 Oct 2014 12:39:41 +0000 Subject: [PATCH] Use DOS return codes. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@49704 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- test/callhooktest.c | 2 +- test/examine.c | 12 ++++++------ test/fileseek.c | 8 ++++---- test/fontinfo.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/callhooktest.c b/test/callhooktest.c index 0cc806a5f3..57ed9c915f 100644 --- a/test/callhooktest.c +++ b/test/callhooktest.c @@ -46,5 +46,5 @@ int main (int argc, char ** argv) ); printf("CallHook result: %lx\n", res); - return (res == 0xbabadada) ? 0 : 1; + return (res == 0xbabadada) ? RETURN_OK : RETURN_FAIL; } diff --git a/test/examine.c b/test/examine.c index 77d6545b69..fa56454ec0 100644 --- a/test/examine.c +++ b/test/examine.c @@ -28,29 +28,29 @@ int main (int argc, char **argv) { struct DateTime dt; char date[32], time[32]; - if (argc == 0) { + if (argc == 1) { printf("usage: %s file\n", argv[0]); - return 1; + return RETURN_FAIL; } lock = Lock(argv[1], SHARED_LOCK); if (lock == BNULL) { printf("couldn't open file [%ld]\n", (long)IoErr()); - return 1; + return RETURN_FAIL; } fib = (struct FileInfoBlock *) AllocDosObject(DOS_FIB, NULL); if (fib == NULL) { printf("couldn't allocate FileInfoBlock structure\n"); UnLock(lock); - return 1; + return RETURN_FAIL; } if (! Examine(lock, fib)) { printf("Examine() failed [%ld]\n", (long)IoErr()); FreeDosObject(DOS_FIB, fib); UnLock(lock); - return 1; + return RETURN_FAIL; } printf("fib_DiskKey : 0x%lx\n", fib->fib_DiskKey); @@ -78,5 +78,5 @@ int main (int argc, char **argv) { FreeDosObject(DOS_FIB, fib); UnLock(lock); - return 0; + return RETURN_OK; } diff --git a/test/fileseek.c b/test/fileseek.c index 8d06649d5a..6215c55a59 100644 --- a/test/fileseek.c +++ b/test/fileseek.c @@ -19,7 +19,7 @@ BPTR file; if ( !fd ) { fprintf( stderr, "Could not write test file seek.txt\n" ); - exit(-1); + exit(RETURN_ERROR); } fprintf( fd, "() does not work!\n" ); fclose(fd); @@ -29,7 +29,7 @@ BPTR file; if ( !fd ) { fprintf( stderr, "Could not open test file seek.txt\n" ); - exit(-1); + exit(RETURN_ERROR); } i = fread( buffer, 1, 1, fd ); //printf("pos=%ld\n",ftell(fd)); @@ -37,7 +37,7 @@ BPTR file; if( i != 7 ) { fprintf( stderr, "Wanted to fread() %d chars, but could only get %d!\n", 6, i-1 ); - exit(-1); + exit(RETURN_ERROR); } fseek( fd, 4, SEEK_CUR ); i = fread( &buffer[7], 1, 11, fd ); @@ -53,5 +53,5 @@ BPTR file; buffer[i] = 0; printf( "\nSeek%s", buffer ); - return 0; + return RETURN_OK; } diff --git a/test/fontinfo.c b/test/fontinfo.c index 3b5e88e208..d8cf1b9a54 100644 --- a/test/fontinfo.c +++ b/test/fontinfo.c @@ -55,7 +55,7 @@ static void cleanup(char *msg) if (myargs) FreeArgs(myargs); - exit(0); + exit(msg == NULL ? RETURN_OK : RETURN_FAIL); } static void getarguments(void) @@ -309,7 +309,7 @@ int main(void) openfont(); action(); if (args[ARG_SHOW]) showfont(); - cleanup(0); + cleanup(NULL); return 0; } -- 2.11.4.GIT