diff options
author | Matt Kraai <kraai@debian.org> | 2000-12-01 05:55:13 +0300 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-12-01 05:55:13 +0300 |
commit | 3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0 (patch) | |
tree | 013a1e7752113314831ad7d51854ce8dc9e0918b /miscutils | |
parent | b558e76eb1ba173ce3501c3e13fb80f426a7faac (diff) |
Stop using TRUE and FALSE for exit status.
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/dc.c | 19 | ||||
-rw-r--r-- | miscutils/dutmp.c | 2 | ||||
-rw-r--r-- | miscutils/mktemp.c | 4 | ||||
-rw-r--r-- | miscutils/mt.c | 8 | ||||
-rw-r--r-- | miscutils/update.c | 6 |
5 files changed, 17 insertions, 22 deletions
diff --git a/miscutils/dc.c b/miscutils/dc.c index 48aa830d6..0f5f1fc77 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -13,19 +13,15 @@ static unsigned int pointer; static void push(double a) { - if (pointer >= (sizeof(stack) / sizeof(*stack))) { - errorMsg("stack overflow\n"); - exit(-1); - } else - stack[pointer++] = a; + if (pointer >= (sizeof(stack) / sizeof(*stack))) + fatalError("stack overflow\n"); + stack[pointer++] = a; } static double pop() { - if (pointer == 0) { - errorMsg("stack underflow\n"); - exit(-1); - } + if (pointer == 0) + fatalError("stack underflow\n"); return stack[--pointer]; } @@ -124,8 +120,7 @@ static void stack_machine(const char *argument) } o++; } - errorMsg("%s: syntax error.\n", argument); - exit(-1); + fatalError("%s: syntax error.\n", argument); } /* return pointer to next token in buffer and set *buffer to one char @@ -182,5 +177,5 @@ int dc_main(int argc, char **argv) } } stack_machine(0); - return( TRUE); + return EXIT_SUCCESS; } diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c index cf5f1cff8..03d80d87d 100644 --- a/miscutils/dutmp.c +++ b/miscutils/dutmp.c @@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv) ut.ut_addr); } #endif - return(TRUE); + return EXIT_SUCCESS; } diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c index 62ca870c5..2d53cc2a4 100644 --- a/miscutils/mktemp.c +++ b/miscutils/mktemp.c @@ -31,7 +31,7 @@ extern int mktemp_main(int argc, char **argv) if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) usage(mktemp_usage); if(mkstemp(argv[argc-1]) < 0) - exit(FALSE); + return EXIT_FAILURE; (void) puts(argv[argc-1]); - return(TRUE); + return EXIT_SUCCESS; } diff --git a/miscutils/mt.c b/miscutils/mt.c index 6acae4ea1..583674b18 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv) if (code->name == 0) { errorMsg("unrecognized opcode %s.\n", argv[1]); - exit (FALSE); + return EXIT_FAILURE; } op.mt_op = code->value; @@ -87,13 +87,13 @@ extern int mt_main(int argc, char **argv) if ((fd = open(file, O_RDONLY, 0)) < 0) { perror(file); - exit (FALSE); + return EXIT_FAILURE; } if (ioctl(fd, MTIOCTOP, &op) != 0) { perror(file); - exit (FALSE); + return EXIT_FAILURE; } - return (TRUE); + return EXIT_SUCCESS; } diff --git a/miscutils/update.c b/miscutils/update.c index 7279d83a8..080cb99c3 100644 --- a/miscutils/update.c +++ b/miscutils/update.c @@ -67,7 +67,7 @@ extern int update_main(int argc, char **argv) pid = fork(); if (pid < 0) - exit(FALSE); + return EXIT_FAILURE; else if (pid == 0) { /* Become a proper daemon */ setsid(); @@ -99,12 +99,12 @@ extern int update_main(int argc, char **argv) syslog(LOG_INFO, "This kernel does not need update(8). Exiting."); closelog(); - exit(TRUE); + return EXIT_SUCCESS; } } } } - return( TRUE); + return EXIT_SUCCESS; } /* |