Stop using TRUE and FALSE for exit status.
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Fri, 1 Dec 2000 02:55:13 +0000 (02:55 +0000)
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Fri, 1 Dec 2000 02:55:13 +0000 (02:55 +0000)
git-svn-id: svn://busybox.net/trunk/busybox@1360 69ca8d6d-28ef-0310-b511-8ec308f3f277

132 files changed:
ar.c
archival/ar.c
archival/gunzip.c
archival/gzip.c
archival/tar.c
basename.c
chmod_chown_chgrp.c
chroot.c
chvt.c
clear.c
cmdedit.c
cmp.c
console-tools/chvt.c
console-tools/clear.c
console-tools/deallocvt.c
console-tools/dumpkmap.c
console-tools/loadacm.c
console-tools/reset.c
console-tools/setkeycodes.c
coreutils/basename.c
coreutils/chroot.c
coreutils/cmp.c
coreutils/cut.c
coreutils/date.c
coreutils/dd.c
coreutils/df.c
coreutils/dirname.c
coreutils/dos2unix.c
coreutils/du.c
coreutils/echo.c
coreutils/hostid.c
coreutils/length.c
coreutils/ls.c
coreutils/md5sum.c
coreutils/mkdir.c
coreutils/mkfifo.c
coreutils/mknod.c
coreutils/pwd.c
coreutils/rm.c
coreutils/sleep.c
coreutils/touch.c
coreutils/tty.c
coreutils/uname.c
coreutils/usleep.c
coreutils/uudecode.c
coreutils/uuencode.c
cp_mv.c
cut.c
date.c
dc.c
dd.c
deallocvt.c
df.c
dirname.c
dmesg.c
dos2unix.c
du.c
dumpkmap.c
dutmp.c
echo.c
fbset.c
fdflush.c
find.c
findutils/find.c
free.c
freeramdisk.c
gunzip.c
gzip.c
hostid.c
insmod.c
kill.c
lash.c
length.c
loadacm.c
ls.c
md5sum.c
miscutils/dc.c
miscutils/dutmp.c
miscutils/mktemp.c
miscutils/mt.c
miscutils/update.c
mkdir.c
mkfifo.c
mknod.c
mkswap.c
mktemp.c
modutils/insmod.c
modutils/rmmod.c
mount.c
mt.c
networking/nslookup.c
networking/ping.c
nslookup.c
ping.c
procps/free.c
procps/kill.c
procps/ps.c
procps/uptime.c
ps.c
pwd.c
rdate.c
reset.c
rm.c
rmmod.c
setkeycodes.c
sh.c
shell/cmdedit.c
shell/lash.c
sleep.c
swaponoff.c
sysklogd/syslogd.c
syslogd.c
tar.c
touch.c
true_false.c
tty.c
umount.c
uname.c
update.c
uptime.c
usleep.c
util-linux/dmesg.c
util-linux/fbset.c
util-linux/fdflush.c
util-linux/freeramdisk.c
util-linux/mkswap.c
util-linux/mount.c
util-linux/rdate.c
util-linux/swaponoff.c
util-linux/umount.c
uudecode.c
uuencode.c

diff --git a/ar.c b/ar.c
index f3ba59b..0f16ec8 100644 (file)
--- a/ar.c
+++ b/ar.c
@@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv)
                }
                extractList=extractList->next;
        }
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index f3ba59b..0f16ec8 100644 (file)
@@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv)
                }
                extractList=extractList->next;
        }
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index 70b25bd..eeff977 100644 (file)
@@ -1350,7 +1350,7 @@ int gunzip_main(int argc, char **argv)
 
                if (delInputFile == 1 && unlink(delFileName) < 0) {
                        perror(delFileName);
-                       exit(FALSE);
+                       return EXIT_FAILURE;
                }
        }
        return(exit_code);
index 2e147b1..d8c22a9 100644 (file)
@@ -1930,7 +1930,7 @@ int gzip_main(int argc, char **argv)
 
                if (unlink(delFileName) < 0) {
                        perror(delFileName);
-                       exit(FALSE);
+                       exit(EXIT_FAILURE);
                }
        }
 
index 826ab96..01997e4 100644 (file)
@@ -156,6 +156,7 @@ extern int tar_main(int argc, char **argv)
        int tostdoutFlag = FALSE;
        int firstOpt = TRUE;
        int stopIt;
+       int status;
                                                                                                                                                   
 
        if (argc <= 1)
@@ -227,16 +228,21 @@ extern int tar_main(int argc, char **argv)
 #ifndef BB_FEATURE_TAR_CREATE
                fatalError( "This version of tar was not compiled with tar creation support.\n");
 #else
-               exit(writeTarFile(tarName, verboseFlag, argv, excludeList));
+               status = writeTarFile(tarName, verboseFlag, argv, excludeList);
 #endif
        }
        if (listFlag == TRUE || extractFlag == TRUE) {
                if (*argv)
                        extractList = argv;
-               exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
-                                       verboseFlag, extractList, excludeList));
+               status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
+                                       verboseFlag, extractList, excludeList);
        }
 
+       if (status == TRUE)
+               return EXIT_SUCCESS;
+       else
+               return EXIT_FAILURE;
+
   flagError:
        fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
 }
index 4d9fc4e..fcc7d46 100644 (file)
@@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv)
                        s[m-n] = '\0';
        }
        printf("%s\n", s);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 1ec7eec..e8ccb81 100644 (file)
@@ -161,9 +161,9 @@ int chmod_chown_chgrp_main(int argc, char **argv)
        while (argc-- > 1) {
                if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE, 
                                        fileAction, fileAction, NULL) == FALSE)
-                       exit(FALSE);
+                       return EXIT_FAILURE;
        }
-       exit(TRUE);
+       return EXIT_SUCCESS;
 
   bad_group:
        fatalError( "unknown group name: %s\n", groupName);
index f0a2981..f279af1 100644 (file)
--- a/chroot.c
+++ b/chroot.c
@@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv)
                execlp(prog, prog, NULL);
 #else
                shell_main(argc, argv);
-               exit (0);
+               return EXIT_SUCCESS;
 #endif
        }
        fatalError("cannot execute %s: %s\n", prog, strerror(errno));
diff --git a/chvt.c b/chvt.c
index d4b16a0..7909645 100644 (file)
--- a/chvt.c
+++ b/chvt.c
@@ -25,13 +25,13 @@ int chvt_main(int argc, char **argv)
        num = atoi(argv[1]);
        if (ioctl(fd, VT_ACTIVATE, num)) {
                perror("VT_ACTIVATE");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
        if (ioctl(fd, VT_WAITACTIVE, num)) {
                perror("VT_WAITACTIVE");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 
diff --git a/clear.c b/clear.c
index 4a8e045..ca83f38 100644 (file)
--- a/clear.c
+++ b/clear.c
@@ -29,5 +29,5 @@
 extern int clear_main(int argc, char **argv)
 {
        printf("\033[H\033[J");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 8115e52..94b8fc7 100644 (file)
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -135,7 +135,7 @@ void clean_up_and_die(int sig)
        cmdedit_reset_term();
        fprintf(stdout, "\n");
        if (sig!=SIGINT)
-               exit(TRUE);
+               exit(EXIT_SUCCESS);
 }
 
 /* Go to HOME position */
diff --git a/cmp.c b/cmp.c
index 98b747e..6b95544 100644 (file)
--- a/cmp.c
+++ b/cmp.c
@@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv)
                        else
                                printf("%s %s differ: char %d, line %d\n", filename1, filename2,
                                                char_pos, line_pos);
-                       return 1;
+                       return EXIT_FAILURE;
                }
                char_pos++;
                if (c1 == '\n')
index d4b16a0..7909645 100644 (file)
@@ -25,13 +25,13 @@ int chvt_main(int argc, char **argv)
        num = atoi(argv[1]);
        if (ioctl(fd, VT_ACTIVATE, num)) {
                perror("VT_ACTIVATE");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
        if (ioctl(fd, VT_WAITACTIVE, num)) {
                perror("VT_WAITACTIVE");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 
index 4a8e045..ca83f38 100644 (file)
@@ -29,5 +29,5 @@
 extern int clear_main(int argc, char **argv)
 {
        printf("\033[H\033[J");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 65af79b..4600c0d 100644 (file)
@@ -28,7 +28,7 @@ printf("erik: A\n");
                /* deallocate all unused consoles */
                if (ioctl(fd, VT_DISALLOCATE, 0)) {
                        perror("VT_DISALLOCATE");
-                       exit( FALSE);
+                       return EXIT_FAILURE;
                }
        } else
 printf("erik: B\n");
@@ -44,5 +44,5 @@ printf("erik: B\n");
                        }
                }
 printf("erik: C\n");
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
index 2d989df..77689fc 100644 (file)
@@ -51,7 +51,7 @@ int dumpkmap_main(int argc, char **argv)
        fd = open("/dev/tty0", O_RDWR);
        if (fd < 0) {
                errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
-               return 1;
+               return EXIT_FAILURE;
        }
 
        write(1, magic, 7);
@@ -88,5 +88,5 @@ int dumpkmap_main(int argc, char **argv)
                }
        }
        close(fd);
-       return 0;
+       return EXIT_SUCCESS;
 }
index f577379..1562108 100644 (file)
@@ -40,17 +40,17 @@ int loadacm_main(int argc, char **argv)
        fd = open("/dev/tty", O_RDWR);
        if (fd < 0) {
                errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
-               return( FALSE);
+               return EXIT_FAILURE;
        }
 
        if (screen_map_load(fd, stdin)) {
                errorMsg("Error loading acm: %s\n", strerror(errno));
-               return( FALSE);
+               return EXIT_FAILURE;
        }
 
        write(fd, "\033(K", 3);
 
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
 
 int screen_map_load(int fd, FILE * fp)
index 8e2c491..bf8c3ed 100644 (file)
@@ -29,6 +29,6 @@
 extern int reset_main(int argc, char **argv)
 {
        printf("\033c");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
index 63c1063..6a31e04 100644 (file)
@@ -68,5 +68,5 @@ setkeycodes_main(int argc, char** argv)
        argc -= 2;
        argv += 2;
     }
-    return( TRUE);
+       return EXIT_SUCCESS;
 }
index 4d9fc4e..fcc7d46 100644 (file)
@@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv)
                        s[m-n] = '\0';
        }
        printf("%s\n", s);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index f0a2981..f279af1 100644 (file)
@@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv)
                execlp(prog, prog, NULL);
 #else
                shell_main(argc, argv);
-               exit (0);
+               return EXIT_SUCCESS;
 #endif
        }
        fatalError("cannot execute %s: %s\n", prog, strerror(errno));
index 98b747e..6b95544 100644 (file)
@@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv)
                        else
                                printf("%s %s differ: char %d, line %d\n", filename1, filename2,
                                                char_pos, line_pos);
-                       return 1;
+                       return EXIT_FAILURE;
                }
                char_pos++;
                if (c1 == '\n')
index 2d313cc..b281fa2 100644 (file)
@@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv)
                }
        }
 
-       return 0;
+       return EXIT_SUCCESS;
 }
index 7e42167..2e69bde 100644 (file)
@@ -232,7 +232,7 @@ int date_main(int argc, char **argv)
        } else if (*date_fmt == '\0') {
                /* Imitate what GNU 'date' does with NO format string! */
                printf("\n");
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 
        /* Handle special conversions */
@@ -246,5 +246,5 @@ int date_main(int argc, char **argv)
        strftime(t_buff, 200, date_fmt, &tm_time);
        printf("%s\n", t_buff);
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 2b77ea6..044f167 100644 (file)
@@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv)
                   (inTotal % blockSize) != 0);
        printf("%ld+%d records out\n", (long) (outTotal / blockSize),
                   (outTotal % blockSize) != 0);
-       exit(TRUE);
+       return EXIT_SUCCESS;
   usage:
 
        usage(dd_usage);
index 8d6242c..aefffc7 100644 (file)
@@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv)
                                exit(FALSE);
                        }
                        status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
-                       if (status != 0)
-                               exit(status);
+                       if (status != TRUE)
+                               return EXIT_FAILURE;
                        argc--;
                        argv++;
                }
-               exit(TRUE);
+               return EXIT_SUCCESS;
        } else {
                FILE *mountTable;
                struct mntent *mountEntry;
@@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv)
                mountTable = setmntent(mtab_file, "r");
                if (mountTable == 0) {
                        perror(mtab_file);
-                       exit(FALSE);
+                       return EXIT_FAILURE;
                }
 
                while ((mountEntry = getmntent(mountTable))) {
@@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv)
                endmntent(mountTable);
        }
 
-       return(TRUE);
+       return EXIT_FAILURE;
 }
 
 /*
index 23f46be..ceb750c 100644 (file)
@@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv)
        if (s && *s)
                *s = '\0';
        printf("%s\n", (s)? *argv : ".");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index c9f783f..ed2088e 100644 (file)
@@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) {
                 putchar(c);
                 c = getchar();
        } 
-       return 0;
+       return EXIT_SUCCESS;
 }
index 408ad99..a0f1606 100644 (file)
@@ -160,10 +160,10 @@ int du_main(int argc, char **argv)
                }
        }
 
-       return(0);
+       return EXIT_SUCCESS;
 }
 
-/* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */
+/* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
index a6b5152..393f442 100644 (file)
@@ -107,7 +107,7 @@ just_echo:
                putchar('\n');
        fflush(stdout);
 
-       return 0;
+       return EXIT_SUCCESS;
 }
 
 /*-
index 47bd8d7..35a5859 100644 (file)
@@ -26,5 +26,5 @@
 extern int hostid_main(int argc, char **argv)
 {
        printf("%lx\n", gethostid());
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 14d15c8..1ab4e3a 100644 (file)
@@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv)
        if (argc != 2 || **(argv + 1) == '-')
                usage(length_usage);
        printf("%lu\n", (long)strlen(argv[1]));
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index d508a1b..225132b 100644 (file)
@@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv)
 
   print_usage_message:
        usage(ls_usage);
-       return(FALSE);
 }
index 21570de..30b882a 100644 (file)
@@ -902,22 +902,22 @@ int md5sum_main(int argc,
 
   if (file_type_specified && do_check) {
     errorMsg("the -b and -t options are meaningless when verifying checksums\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (n_strings > 0 && do_check) {
     errorMsg("the -g and -c options are mutually exclusive\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (status_only && !do_check) {
     errorMsg("the -s option is meaningful only when verifying checksums\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (warn && !do_check) {
     errorMsg("the -w option is meaningful only when verifying checksums\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (n_strings > 0) {
@@ -925,7 +925,7 @@ int md5sum_main(int argc,
 
     if (optind < argc) {
       errorMsg("no files may be specified when using -g\n");
-      exit FALSE;
+         return EXIT_FAILURE;
     }
     for (i = 0; i < n_strings; ++i) {
       size_t cnt;
@@ -992,13 +992,16 @@ int md5sum_main(int argc,
 
   if (fclose (stdout) == EOF) {
     errorMsg("write error\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (have_read_stdin && fclose (stdin) == EOF) {
     errorMsg("standard input\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
-  exit (err == 0 ? TRUE : FALSE);
+  if (err == 0)
+         return EXIT_SUCCESS;
+  else
+         return EXIT_FAILURE;
 }
index 04310e4..c950847 100644 (file)
@@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv)
                                mode = 0;
                                if (parse_mode(*(++argv), &mode) == FALSE) {
                                        errorMsg("Unknown mode: %s\n", *argv);
-                                       exit FALSE;
+                                       return EXIT_FAILURE;
                                }
                                /* Set the umask for this process so it doesn't 
                                 * screw up whatever the user just entered. */
@@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv)
 
                if (strlen(*argv) > BUFSIZ - 1) {
                        errorMsg(name_too_long);
-                       exit FALSE;
+                       return EXIT_FAILURE;
                }
                strcpy(buf, *argv);
                status = stat(buf, &statBuf);
                if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
                        errorMsg("%s: File exists\n", buf);
-                       exit FALSE;
+                       return EXIT_FAILURE;
                }
                if (parentFlag == TRUE) {
                        strcat(buf, "/");
@@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv)
                } else {
                        if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
                                perror(buf);
-                               exit FALSE;
+                               return EXIT_FAILURE;
                        }
                }
                argc--;
                argv++;
        }
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
index 5e1bc1a..ef4a525 100644 (file)
@@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv)
                usage(mkfifo_usage);
        if (mkfifo(*argv, mode) < 0) {
                perror("mkfifo");
-               exit(255);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index ecb0e47..21b2689 100644 (file)
@@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv)
 
        if (mknod(argv[0], mode, dev) != 0)
                fatalError("%s: %s\n", argv[0], strerror(errno));
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
 
index c9de777..54129b1 100644 (file)
@@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv)
                fatalError("%s\n", strerror(errno));
 
        printf("%s\n", buf);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 4f97cad..c62083e 100644 (file)
@@ -102,9 +102,9 @@ extern int rm_main(int argc, char **argv)
                } else {
                        if (recursiveAction(srcName, recursiveFlag, FALSE,
                                                                TRUE, fileAction, dirAction, NULL) == FALSE) {
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
                }
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 709e3de..ad92b10 100644 (file)
@@ -32,7 +32,7 @@ extern int sleep_main(int argc, char **argv)
 
        if (sleep(atoi(*(++argv))) != 0) {
                perror("sleep");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 7db6c6e..5537fb6 100644 (file)
@@ -43,7 +43,6 @@ extern int touch_main(int argc, char **argv)
                                break;
                        default:
                                usage(touch_usage);
-                               exit(FALSE);
                        }
                }
        }
@@ -57,7 +56,7 @@ extern int touch_main(int argc, char **argv)
                                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                if (fd < 0) {
                        if (create == FALSE && errno == ENOENT)
-                               exit(TRUE);
+                               return EXIT_SUCCESS;
                        else {
                                fatalError("%s", strerror(errno));
                        }
@@ -70,5 +69,5 @@ extern int touch_main(int argc, char **argv)
                argv++;
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 6eebed9..46201d3 100644 (file)
@@ -38,5 +38,5 @@ extern int tty_main(int argc, char **argv)
                else
                        puts("not a tty");
        }
-       return(isatty(0) ? TRUE : FALSE);
+       return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE);
 }
index 8d9427c..2781b80 100644 (file)
@@ -138,7 +138,7 @@ int uname_main(int argc, char **argv)
        print_element(PRINT_MACHINE, name.machine);
        print_element(PRINT_PROCESSOR, processor);
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /* If the name element set in MASK is selected for printing in `toprint',
index 69790ef..86dc050 100644 (file)
@@ -32,5 +32,5 @@ extern int usleep_main(int argc, char **argv)
        }
 
        usleep(atoi(*(++argv)));        /* return void */
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 78ca096..825fdb5 100644 (file)
@@ -294,16 +294,16 @@ int uudecode_main (int argc,
   }
 
   if (optind == argc)
-    exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE;
+    exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
   else {
-    exit_status = TRUE;
+    exit_status = EXIT_SUCCESS;
     do {
       if (freopen (argv[optind], "r", stdin) != NULL) {
         if (decode (argv[optind], outname) != 0)
           exit_status = FALSE;
       } else {
         errorMsg("%s: %s\n", argv[optind], strerror(errno));
-        exit_status = FALSE;
+        exit_status = EXIT_FAILURE;
       }
       optind++;
     }
index aea99ed..8d15adb 100644 (file)
@@ -179,7 +179,7 @@ int uuencode_main (int argc,
     /* Optional first argument is input file.  */
     if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
       errorMsg("%s: %s\n", argv[optind], strerror(errno));
-      exit FALSE;
+      return EXIT_FAILURE;
     }
     mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
     optind++;
@@ -200,9 +200,9 @@ int uuencode_main (int argc,
   printf(trans_ptr == uu_std ? "end\n" : "====\n");
   if (ferror (stdout)) {
     errorMsg("Write error\n");
-    exit FALSE;
+    return EXIT_FAILURE;
   }
-  return( TRUE);
+  return EXIT_SUCCESS;
 }
 
 /* Copyright (c) 1983 Regents of the University of California.
diff --git a/cp_mv.c b/cp_mv.c
index 2257f44..580c920 100644 (file)
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -316,9 +316,9 @@ extern int cp_mv_main(int argc, char **argv)
                if (flags_memo)
                        *(baseDestName + baseDestLen) = '\0';
        }
-       return( TRUE);
+       return EXIT_SUCCESS;
  exit_false:
-       return( FALSE);
+       return EXIT_FAILURE;
 }
 
 /*
diff --git a/cut.c b/cut.c
index 2d313cc..b281fa2 100644 (file)
--- a/cut.c
+++ b/cut.c
@@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv)
                }
        }
 
-       return 0;
+       return EXIT_SUCCESS;
 }
diff --git a/date.c b/date.c
index 7e42167..2e69bde 100644 (file)
--- a/date.c
+++ b/date.c
@@ -232,7 +232,7 @@ int date_main(int argc, char **argv)
        } else if (*date_fmt == '\0') {
                /* Imitate what GNU 'date' does with NO format string! */
                printf("\n");
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 
        /* Handle special conversions */
@@ -246,5 +246,5 @@ int date_main(int argc, char **argv)
        strftime(t_buff, 200, date_fmt, &tm_time);
        printf("%s\n", t_buff);
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/dc.c b/dc.c
index 48aa830..0f5f1fc 100644 (file)
--- a/dc.c
+++ b/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/dd.c b/dd.c
index 2b77ea6..044f167 100644 (file)
--- a/dd.c
+++ b/dd.c
@@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv)
                   (inTotal % blockSize) != 0);
        printf("%ld+%d records out\n", (long) (outTotal / blockSize),
                   (outTotal % blockSize) != 0);
-       exit(TRUE);
+       return EXIT_SUCCESS;
   usage:
 
        usage(dd_usage);
index 65af79b..4600c0d 100644 (file)
@@ -28,7 +28,7 @@ printf("erik: A\n");
                /* deallocate all unused consoles */
                if (ioctl(fd, VT_DISALLOCATE, 0)) {
                        perror("VT_DISALLOCATE");
-                       exit( FALSE);
+                       return EXIT_FAILURE;
                }
        } else
 printf("erik: B\n");
@@ -44,5 +44,5 @@ printf("erik: B\n");
                        }
                }
 printf("erik: C\n");
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/df.c b/df.c
index 8d6242c..aefffc7 100644 (file)
--- a/df.c
+++ b/df.c
@@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv)
                                exit(FALSE);
                        }
                        status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
-                       if (status != 0)
-                               exit(status);
+                       if (status != TRUE)
+                               return EXIT_FAILURE;
                        argc--;
                        argv++;
                }
-               exit(TRUE);
+               return EXIT_SUCCESS;
        } else {
                FILE *mountTable;
                struct mntent *mountEntry;
@@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv)
                mountTable = setmntent(mtab_file, "r");
                if (mountTable == 0) {
                        perror(mtab_file);
-                       exit(FALSE);
+                       return EXIT_FAILURE;
                }
 
                while ((mountEntry = getmntent(mountTable))) {
@@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv)
                endmntent(mountTable);
        }
 
-       return(TRUE);
+       return EXIT_FAILURE;
 }
 
 /*
index 23f46be..ceb750c 100644 (file)
--- a/dirname.c
+++ b/dirname.c
@@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv)
        if (s && *s)
                *s = '\0';
        printf("%s\n", (s)? *argv : ".");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/dmesg.c b/dmesg.c
index 88b5d13..a32ca79 100644 (file)
--- a/dmesg.c
+++ b/dmesg.c
@@ -73,7 +73,7 @@ int dmesg_main(int argc, char **argv)
                if (n < 0) {
                        goto klogctl_error;
                }
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 
        if (bufsize < 4096)
@@ -98,11 +98,11 @@ int dmesg_main(int argc, char **argv)
        }
        if (lastc != '\n')
                putchar('\n');
-       exit(TRUE);
+       return EXIT_SUCCESS;
   end:
        usage(dmesg_usage);
-       exit(FALSE);
+       return EXIT_FAILURE;
   klogctl_error:
        perror("klogctl");
-       return(FALSE);
+       return EXIT_FAILURE;
 }
index c9f783f..ed2088e 100644 (file)
@@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) {
                 putchar(c);
                 c = getchar();
        } 
-       return 0;
+       return EXIT_SUCCESS;
 }
diff --git a/du.c b/du.c
index 408ad99..a0f1606 100644 (file)
--- a/du.c
+++ b/du.c
@@ -160,10 +160,10 @@ int du_main(int argc, char **argv)
                }
        }
 
-       return(0);
+       return EXIT_SUCCESS;
 }
 
-/* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */
+/* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
index 2d989df..77689fc 100644 (file)
@@ -51,7 +51,7 @@ int dumpkmap_main(int argc, char **argv)
        fd = open("/dev/tty0", O_RDWR);
        if (fd < 0) {
                errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
-               return 1;
+               return EXIT_FAILURE;
        }
 
        write(1, magic, 7);
@@ -88,5 +88,5 @@ int dumpkmap_main(int argc, char **argv)
                }
        }
        close(fd);
-       return 0;
+       return EXIT_SUCCESS;
 }
diff --git a/dutmp.c b/dutmp.c
index cf5f1cf..03d80d8 100644 (file)
--- a/dutmp.c
+++ b/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/echo.c b/echo.c
index a6b5152..393f442 100644 (file)
--- a/echo.c
+++ b/echo.c
@@ -107,7 +107,7 @@ just_echo:
                putchar('\n');
        fflush(stdout);
 
-       return 0;
+       return EXIT_SUCCESS;
 }
 
 /*-
diff --git a/fbset.c b/fbset.c
index 8307f26..47130e3 100644 (file)
--- a/fbset.c
+++ b/fbset.c
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
        if (g_options & OPT_READMODE) {
                if (!readmode(&var, modefile, mode)) {
                        errorMsg("Unknown video mode `%s'\n", mode);
-                       exit(1);
+                       return EXIT_FAILURE;
                }
        }
 
@@ -446,5 +446,5 @@ extern int fbset_main(int argc, char **argv)
        /* Don't close the file, as exiting will take care of that */
        /* close(fh); */
 
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index 6633e12..380015d 100644 (file)
--- a/fdflush.c
+++ b/fdflush.c
@@ -40,7 +40,7 @@ extern int fdflush_main(int argc, char **argv)
        fd = open(*argv, 0);
        if (fd < 0) {
                perror(*argv);
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
        value = ioctl(fd, FDFLUSH, 0);
@@ -50,7 +50,7 @@ extern int fdflush_main(int argc, char **argv)
 
        if (value) {
                perror(*argv);
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/find.c b/find.c
index 48faf2c..a86b07e 100644 (file)
--- a/find.c
+++ b/find.c
@@ -100,8 +100,8 @@ int find_main(int argc, char **argv)
 
        if (recursiveAction(directory, TRUE, FALSE, FALSE,
                                                fileAction, fileAction, NULL) == FALSE) {
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 48faf2c..a86b07e 100644 (file)
@@ -100,8 +100,8 @@ int find_main(int argc, char **argv)
 
        if (recursiveAction(directory, TRUE, FALSE, FALSE,
                                                fileAction, fileAction, NULL) == FALSE) {
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/free.c b/free.c
index a33fa9a..f2e746e 100644 (file)
--- a/free.c
+++ b/free.c
@@ -60,7 +60,7 @@ extern int free_main(int argc, char **argv)
        printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
                        (info.totalram-info.freeram)+(info.totalswap-info.freeswap),
                        info.freeram+info.freeswap);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 
index 22fc3e6..5671514 100644 (file)
@@ -51,7 +51,7 @@ freeramdisk_main(int argc, char **argv)
        /* Don't bother closing.  Exit does
         * that, so we can save a few bytes */
        /* close(f); */
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /*
index 70b25bd..eeff977 100644 (file)
--- a/gunzip.c
+++ b/gunzip.c
@@ -1350,7 +1350,7 @@ int gunzip_main(int argc, char **argv)
 
                if (delInputFile == 1 && unlink(delFileName) < 0) {
                        perror(delFileName);
-                       exit(FALSE);
+                       return EXIT_FAILURE;
                }
        }
        return(exit_code);
diff --git a/gzip.c b/gzip.c
index 2e147b1..d8c22a9 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -1930,7 +1930,7 @@ int gzip_main(int argc, char **argv)
 
                if (unlink(delFileName) < 0) {
                        perror(delFileName);
-                       exit(FALSE);
+                       exit(EXIT_FAILURE);
                }
        }
 
index 47bd8d7..35a5859 100644 (file)
--- a/hostid.c
+++ b/hostid.c
@@ -26,5 +26,5 @@
 extern int hostid_main(int argc, char **argv)
 {
        printf("%lx\n", gethostid());
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 4f96c95..6386b94 100644 (file)
--- a/insmod.c
+++ b/insmod.c
@@ -77,7 +77,7 @@
 #ifndef MODUTILS_MODULE_H
 #define MODUTILS_MODULE_H 1
 
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
 
 /* This file contains the structures used by the 2.0 and 2.1 kernels.
    We do not use the kernel headers directly because we do not wish
@@ -283,7 +283,7 @@ int delete_module(const char *);
 #ifndef MODUTILS_OBJ_H
 #define MODUTILS_OBJ_H 1
 
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
 
 /* The relocatable object is manipulated using elfin types.  */
 
@@ -2769,7 +2769,7 @@ extern int insmod_main( int argc, char **argv)
        FILE *fp;
        struct obj_file *f;
        char m_name[BUFSIZ + 1] = "\0";
-       int exit_status = FALSE;
+       int exit_status = EXIT_FAILURE;
        int m_has_modinfo;
 #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
        int k_version;
@@ -2833,7 +2833,7 @@ extern int insmod_main( int argc, char **argv)
                                || ((fp = fopen(m_filename, "r")) == NULL)) 
                        {
                                errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
                } else
                        fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
@@ -2843,7 +2843,7 @@ extern int insmod_main( int argc, char **argv)
 
        if ((f = obj_load(fp)) == NULL) {
                perror("Could not load the module\n");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
        if (get_modinfo_value(f, "kernel_version") == NULL)
@@ -2981,7 +2981,7 @@ extern int insmod_main( int argc, char **argv)
                goto out;
        }
 
-       exit_status = TRUE;
+       exit_status = EXIT_SUCCESS;
 
 out:
        fclose(fp);
diff --git a/kill.c b/kill.c
index 7ade822..dd5ca49 100644 (file)
--- a/kill.c
+++ b/kill.c
@@ -158,7 +158,7 @@ extern int kill_main(int argc, char **argv)
                                                }
                                        }
                                        fprintf(stderr, "\n\n");
-                                       exit(TRUE);
+                                       return EXIT_SUCCESS;
                                }
                                break;
                        case '-':
@@ -236,11 +236,12 @@ extern int kill_main(int argc, char **argv)
                         * upon exit, so we can save a byte or two */
                        argv++;
                }
-               exit (all_found);
+               if (all_found == FALSE)
+                       return EXIT_FAILURE;
        }
 #endif
 
-       exit(TRUE);
+       return EXIT_SUCCESS;
 
 
   end:
diff --git a/lash.c b/lash.c
index 461f2c0..1524ef1 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk)
                newdir = cmd->progs[0].argv[1];
        if (chdir(newdir)) {
                printf("cd: %s: %s\n", newdir, strerror(errno));
-               return FALSE;
+               return EXIT_FAILURE;
        }
        getcwd(cwd, sizeof(char)*MAX_LINE);
 
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'env' handler */
@@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk)
                fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
                                strerror(errno));
        }
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'exit' handler */
 static int builtin_exit(struct job *cmd, struct jobSet *junk)
 {
        if (!cmd->progs[0].argv[1] == 1)
-               exit TRUE;
+               exit(EXIT_SUCCESS);
 
        exit (atoi(cmd->progs[0].argv[1]));
 }
@@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
                if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
                        errorMsg("%s: exactly one argument is expected\n",
                                        cmd->progs[0].argv[0]);
-                       return FALSE;
+                       return EXIT_FAILURE;
                }
                if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
                        errorMsg("%s: bad argument '%s'\n",
                                        cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
-                       return FALSE;
+                       return EXIT_FAILURE;
                        for (job = jobList->head; job; job = job->next) {
                                if (job->jobId == jobNum) {
                                        break;
@@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
        if (!job) {
                errorMsg("%s: unknown job %d\n",
                                cmd->progs[0].argv[0], jobNum);
-               return FALSE;
+               return EXIT_FAILURE;
        }
 
        if (*cmd->progs[0].argv[0] == 'f') {
@@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
 
        job->stoppedProgs = 0;
 
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'help' handler */
@@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk)
                fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
        }
        fprintf(stdout, "\n\n");
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'jobs' handler */
@@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList)
 
                printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
        }
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 
@@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk)
 {
        getcwd(cwd, sizeof(char)*MAX_LINE);
        fprintf(stdout, "%s\n", cwd);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'export VAR=value' handler */
@@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk)
 
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `then'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* If the if result was FALSE, skip the 'then' stuff */
        if (cmd->jobContext & IF_FALSE_CONTEXT) {
-               return TRUE;
+               return EXIT_SUCCESS;
        }
 
        cmd->jobContext |= THEN_EXP_CONTEXT;
@@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk)
 
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `else'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* If the if result was TRUE, skip the 'else' stuff */
        if (cmd->jobContext & IF_TRUE_CONTEXT) {
-               return TRUE;
+               return EXIT_SUCCESS;
        }
 
        cmd->jobContext |= ELSE_EXP_CONTEXT;
@@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk)
 {
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `fi'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* Clear out the if and then context bits */
        cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
        debug_printf(stderr, "Hit an fi   -- jobContext=%d\n", cmd->jobContext);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 #endif
 
@@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk)
        int status;
 
        if (!cmd->progs[0].argv[1] == 1)
-               return FALSE;
+               return EXIT_FAILURE;
 
        input = fopen(cmd->progs[0].argv[1], "r");
        if (!input) {
                fprintf(stdout, "Couldn't open file '%s'\n",
                                cmd->progs[0].argv[1]);
-               return FALSE;
+               return EXIT_FAILURE;
        }
 
        /* Now run the file */
@@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk)
 {
        if (!cmd->progs[0].argv[1] == 1) {
                fprintf(stdout, "unset: parameter required.\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        unsetenv(cmd->progs[0].argv[1]);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* free up all memory from a job */
index 14d15c8..1ab4e3a 100644 (file)
--- a/length.c
+++ b/length.c
@@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv)
        if (argc != 2 || **(argv + 1) == '-')
                usage(length_usage);
        printf("%lu\n", (long)strlen(argv[1]));
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index f577379..1562108 100644 (file)
--- a/loadacm.c
+++ b/loadacm.c
@@ -40,17 +40,17 @@ int loadacm_main(int argc, char **argv)
        fd = open("/dev/tty", O_RDWR);
        if (fd < 0) {
                errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
-               return( FALSE);
+               return EXIT_FAILURE;
        }
 
        if (screen_map_load(fd, stdin)) {
                errorMsg("Error loading acm: %s\n", strerror(errno));
-               return( FALSE);
+               return EXIT_FAILURE;
        }
 
        write(fd, "\033(K", 3);
 
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
 
 int screen_map_load(int fd, FILE * fp)
diff --git a/ls.c b/ls.c
index d508a1b..225132b 100644 (file)
--- a/ls.c
+++ b/ls.c
@@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv)
 
   print_usage_message:
        usage(ls_usage);
-       return(FALSE);
 }
index 21570de..30b882a 100644 (file)
--- a/md5sum.c
+++ b/md5sum.c
@@ -902,22 +902,22 @@ int md5sum_main(int argc,
 
   if (file_type_specified && do_check) {
     errorMsg("the -b and -t options are meaningless when verifying checksums\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (n_strings > 0 && do_check) {
     errorMsg("the -g and -c options are mutually exclusive\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (status_only && !do_check) {
     errorMsg("the -s option is meaningful only when verifying checksums\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (warn && !do_check) {
     errorMsg("the -w option is meaningful only when verifying checksums\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (n_strings > 0) {
@@ -925,7 +925,7 @@ int md5sum_main(int argc,
 
     if (optind < argc) {
       errorMsg("no files may be specified when using -g\n");
-      exit FALSE;
+         return EXIT_FAILURE;
     }
     for (i = 0; i < n_strings; ++i) {
       size_t cnt;
@@ -992,13 +992,16 @@ int md5sum_main(int argc,
 
   if (fclose (stdout) == EOF) {
     errorMsg("write error\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
   if (have_read_stdin && fclose (stdin) == EOF) {
     errorMsg("standard input\n");
-    exit FALSE;
+       return EXIT_FAILURE;
   }
 
-  exit (err == 0 ? TRUE : FALSE);
+  if (err == 0)
+         return EXIT_SUCCESS;
+  else
+         return EXIT_FAILURE;
 }
index 48aa830..0f5f1fc 100644 (file)
@@ -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;
 }
index cf5f1cf..03d80d8 100644 (file)
@@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv)
                ut.ut_addr);
        }
 #endif
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 62ca870..2d53cc2 100644 (file)
@@ -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;
 }
index 6acae4e..583674b 100644 (file)
@@ -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;
 }
index 7279d83..080cb99 100644 (file)
@@ -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;
 }
 
 /*
diff --git a/mkdir.c b/mkdir.c
index 04310e4..c950847 100644 (file)
--- a/mkdir.c
+++ b/mkdir.c
@@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv)
                                mode = 0;
                                if (parse_mode(*(++argv), &mode) == FALSE) {
                                        errorMsg("Unknown mode: %s\n", *argv);
-                                       exit FALSE;
+                                       return EXIT_FAILURE;
                                }
                                /* Set the umask for this process so it doesn't 
                                 * screw up whatever the user just entered. */
@@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv)
 
                if (strlen(*argv) > BUFSIZ - 1) {
                        errorMsg(name_too_long);
-                       exit FALSE;
+                       return EXIT_FAILURE;
                }
                strcpy(buf, *argv);
                status = stat(buf, &statBuf);
                if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
                        errorMsg("%s: File exists\n", buf);
-                       exit FALSE;
+                       return EXIT_FAILURE;
                }
                if (parentFlag == TRUE) {
                        strcat(buf, "/");
@@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv)
                } else {
                        if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
                                perror(buf);
-                               exit FALSE;
+                               return EXIT_FAILURE;
                        }
                }
                argc--;
                argv++;
        }
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
index 5e1bc1a..ef4a525 100644 (file)
--- a/mkfifo.c
+++ b/mkfifo.c
@@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv)
                usage(mkfifo_usage);
        if (mkfifo(*argv, mode) < 0) {
                perror("mkfifo");
-               exit(255);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/mknod.c b/mknod.c
index ecb0e47..21b2689 100644 (file)
--- a/mknod.c
+++ b/mknod.c
@@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv)
 
        if (mknod(argv[0], mode, dev) != 0)
                fatalError("%s: %s\n", argv[0], strerror(errno));
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
 
index 627d04f..4757e15 100644 (file)
--- a/mkswap.c
+++ b/mkswap.c
@@ -176,7 +176,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr)
 void die(const char *str)
 {
        errorMsg("%s\n", str);
-       exit(FALSE);
+       exit(EXIT_FAILURE);
 }
 
 void page_ok(int page)
@@ -325,7 +325,7 @@ int mkswap_main(int argc, char **argv)
        } else if (PAGES > sz && !force) {
                errorMsg("error: size %ld is larger than device size %d\n",
                                PAGES * (pagesize / 1024), sz * (pagesize / 1024));
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
        if (version == -1) {
@@ -369,7 +369,7 @@ int mkswap_main(int argc, char **argv)
        DEV = open(device_name, O_RDWR);
        if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
                perror(device_name);
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
        if (!S_ISBLK(statbuf.st_mode))
                check = 0;
@@ -393,7 +393,7 @@ int mkswap_main(int argc, char **argv)
 "This probably means creating v0 swap would destroy your partition table\n"
 "No swap created. If you really want to create swap v0 on that device, use\n"
 "the -f option to force it.\n", device_name);
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
                }
        }
@@ -429,5 +429,5 @@ int mkswap_main(int argc, char **argv)
         */
        if (fsync(DEV))
                die("fsync failed");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 62ca870..2d53cc2 100644 (file)
--- a/mktemp.c
+++ b/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;
 }
index 4f96c95..6386b94 100644 (file)
@@ -77,7 +77,7 @@
 #ifndef MODUTILS_MODULE_H
 #define MODUTILS_MODULE_H 1
 
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
 
 /* This file contains the structures used by the 2.0 and 2.1 kernels.
    We do not use the kernel headers directly because we do not wish
@@ -283,7 +283,7 @@ int delete_module(const char *);
 #ifndef MODUTILS_OBJ_H
 #define MODUTILS_OBJ_H 1
 
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
 
 /* The relocatable object is manipulated using elfin types.  */
 
@@ -2769,7 +2769,7 @@ extern int insmod_main( int argc, char **argv)
        FILE *fp;
        struct obj_file *f;
        char m_name[BUFSIZ + 1] = "\0";
-       int exit_status = FALSE;
+       int exit_status = EXIT_FAILURE;
        int m_has_modinfo;
 #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
        int k_version;
@@ -2833,7 +2833,7 @@ extern int insmod_main( int argc, char **argv)
                                || ((fp = fopen(m_filename, "r")) == NULL)) 
                        {
                                errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
                } else
                        fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
@@ -2843,7 +2843,7 @@ extern int insmod_main( int argc, char **argv)
 
        if ((f = obj_load(fp)) == NULL) {
                perror("Could not load the module\n");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
        if (get_modinfo_value(f, "kernel_version") == NULL)
@@ -2981,7 +2981,7 @@ extern int insmod_main( int argc, char **argv)
                goto out;
        }
 
-       exit_status = TRUE;
+       exit_status = EXIT_SUCCESS;
 
 out:
        fclose(fp);
index dd29352..f5d7d35 100644 (file)
@@ -34,7 +34,7 @@ _syscall1(int, delete_module, const char *, name)
 
 extern int rmmod_main(int argc, char **argv)
 {
-       int ret = TRUE;
+       int ret = EXIT_SUCCESS;
        if (argc <= 1) {
                usage(rmmod_usage);
        }
@@ -47,9 +47,9 @@ extern int rmmod_main(int argc, char **argv)
                                /* Unload _all_ unused modules via NULL delete_module() call */
                                if (delete_module(NULL)) {
                                        perror("rmmod");
-                                       exit(FALSE);
+                                       return EXIT_FAILURE;
                                }
-                               exit(TRUE);
+                               return EXIT_SUCCESS;
                        default:
                                usage(rmmod_usage);
                        }
@@ -59,7 +59,7 @@ extern int rmmod_main(int argc, char **argv)
        while (argc-- > 0) {
                if (delete_module(*argv) < 0) {
                        perror(*argv);
-                       ret=FALSE;
+                       ret = EXIT_FAILURE;
                }
                argv++;
        }
diff --git a/mount.c b/mount.c
index 8b115c9..34dbb5e 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -330,7 +330,7 @@ extern int mount_main(int argc, char **argv)
        int fakeIt = FALSE;
        int useMtab = TRUE;
        int i;
-       int rc = FALSE;
+       int rc = EXIT_FAILURE;
        int fstabmount = FALSE; 
 
 #if defined BB_FEATURE_USE_DEVPS_PATCH
@@ -367,7 +367,7 @@ extern int mount_main(int argc, char **argv)
                free( mntentlist);
                close(fd);
 #endif
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 #else
        if (argc == 1) {
@@ -388,7 +388,7 @@ extern int mount_main(int argc, char **argv)
                } else {
                        perror(mtab_file);
                }
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 #endif
 
@@ -489,7 +489,7 @@ singlemount:
                                        &extra_opts, &string_flags, 1);
                                if ( rc != 0) {
                                        fatalError("nfsmount failed: %s\n", strerror(errno));   
-                                       rc = FALSE;
+                                       rc = EXIT_FAILURE;
                                }
                        }
 #endif
@@ -499,7 +499,7 @@ singlemount:
                        if (all == FALSE)
                                break;
 
-                       rc = TRUE;      // Always return 0 for 'all'
+                       rc = EXIT_SUCCESS;      // Always return 0 for 'all'
                }
                if (fstabmount == TRUE)
                        endmntent(f);
@@ -512,8 +512,6 @@ singlemount:
        
        goto singlemount;
        
-       exit(FALSE);
-
 goodbye:
        usage(mount_usage);
 }
diff --git a/mt.c b/mt.c
index 6acae4e..583674b 100644 (file)
--- a/mt.c
+++ b/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;
 }
index acb3e3b..c46a0b8 100644 (file)
@@ -167,7 +167,7 @@ int nslookup_main(int argc, char **argv)
                host = gethostbyname(argv[1]);
        }
        hostent_fprint(host, stdout);
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
 
-/* $Id: nslookup.c,v 1.12 2000/09/25 21:45:58 andersen Exp $ */
+/* $Id: nslookup.c,v 1.13 2000/12/01 02:55:13 kraai Exp $ */
index a436309..af109cf 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: ping.c,v 1.26 2000/11/14 23:29:24 andersen Exp $
+ * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $
  * Mini ping implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -256,7 +256,7 @@ extern int ping_main(int argc, char **argv)
        if (argc < 1)
                usage(ping_usage);
        ping(*argv);
-       exit(TRUE);
+       return EXIT_SUCCESS;
 }
 
 #else /* ! BB_FEATURE_SIMPLE_PING */
@@ -546,7 +546,7 @@ extern int ping_main(int argc, char **argv)
 
        myid = getpid() & 0xFFFF;
        ping(*argv);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 #endif /* ! BB_FEATURE_SIMPLE_PING */
 
index acb3e3b..c46a0b8 100644 (file)
@@ -167,7 +167,7 @@ int nslookup_main(int argc, char **argv)
                host = gethostbyname(argv[1]);
        }
        hostent_fprint(host, stdout);
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
 
-/* $Id: nslookup.c,v 1.12 2000/09/25 21:45:58 andersen Exp $ */
+/* $Id: nslookup.c,v 1.13 2000/12/01 02:55:13 kraai Exp $ */
diff --git a/ping.c b/ping.c
index a436309..af109cf 100644 (file)
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: ping.c,v 1.26 2000/11/14 23:29:24 andersen Exp $
+ * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $
  * Mini ping implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -256,7 +256,7 @@ extern int ping_main(int argc, char **argv)
        if (argc < 1)
                usage(ping_usage);
        ping(*argv);
-       exit(TRUE);
+       return EXIT_SUCCESS;
 }
 
 #else /* ! BB_FEATURE_SIMPLE_PING */
@@ -546,7 +546,7 @@ extern int ping_main(int argc, char **argv)
 
        myid = getpid() & 0xFFFF;
        ping(*argv);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 #endif /* ! BB_FEATURE_SIMPLE_PING */
 
index a33fa9a..f2e746e 100644 (file)
@@ -60,7 +60,7 @@ extern int free_main(int argc, char **argv)
        printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
                        (info.totalram-info.freeram)+(info.totalswap-info.freeswap),
                        info.freeram+info.freeswap);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 
index 7ade822..dd5ca49 100644 (file)
@@ -158,7 +158,7 @@ extern int kill_main(int argc, char **argv)
                                                }
                                        }
                                        fprintf(stderr, "\n\n");
-                                       exit(TRUE);
+                                       return EXIT_SUCCESS;
                                }
                                break;
                        case '-':
@@ -236,11 +236,12 @@ extern int kill_main(int argc, char **argv)
                         * upon exit, so we can save a byte or two */
                        argv++;
                }
-               exit (all_found);
+               if (all_found == FALSE)
+                       return EXIT_FAILURE;
        }
 #endif
 
-       exit(TRUE);
+       return EXIT_SUCCESS;
 
 
   end:
index df32161..4998e15 100644 (file)
@@ -183,7 +183,7 @@ extern int ps_main(int argc, char **argv)
                fprintf(stdout, "\n");
        }
        closedir(dir);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 
index fe4e48c..159f24b 100644 (file)
@@ -70,5 +70,5 @@ extern int uptime_main(int argc, char **argv)
                        LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), 
                        LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/ps.c b/ps.c
index df32161..4998e15 100644 (file)
--- a/ps.c
+++ b/ps.c
@@ -183,7 +183,7 @@ extern int ps_main(int argc, char **argv)
                fprintf(stdout, "\n");
        }
        closedir(dir);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 
diff --git a/pwd.c b/pwd.c
index c9de777..54129b1 100644 (file)
--- a/pwd.c
+++ b/pwd.c
@@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv)
                fatalError("%s\n", strerror(errno));
 
        printf("%s\n", buf);
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/rdate.c b/rdate.c
index 80b37de..7c8d541 100644 (file)
--- a/rdate.c
+++ b/rdate.c
@@ -101,7 +101,6 @@ int rdate_main(int argc, char **argv)
                        default:
                        case 'H':
                                usage(rdate_usage);
-                               return(FALSE);
                                break;
                        case 's':
                                setdate++;
@@ -117,11 +116,10 @@ int rdate_main(int argc, char **argv)
 
        if (optind == argc) {
                usage(rdate_usage);
-               return(FALSE);
        }
 
        if ((time= askremotedate(argv[optind])) == (time_t)-1) {
-               return(FALSE);
+               return EXIT_FAILURE;
        }
        if (setdate) {
                if (stime(&time) < 0)
@@ -131,5 +129,5 @@ int rdate_main(int argc, char **argv)
                fprintf(stdout, "%s", ctime(&time));
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/reset.c b/reset.c
index 8e2c491..bf8c3ed 100644 (file)
--- a/reset.c
+++ b/reset.c
@@ -29,6 +29,6 @@
 extern int reset_main(int argc, char **argv)
 {
        printf("\033c");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
diff --git a/rm.c b/rm.c
index 4f97cad..c62083e 100644 (file)
--- a/rm.c
+++ b/rm.c
@@ -102,9 +102,9 @@ extern int rm_main(int argc, char **argv)
                } else {
                        if (recursiveAction(srcName, recursiveFlag, FALSE,
                                                                TRUE, fileAction, dirAction, NULL) == FALSE) {
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
                }
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/rmmod.c b/rmmod.c
index dd29352..f5d7d35 100644 (file)
--- a/rmmod.c
+++ b/rmmod.c
@@ -34,7 +34,7 @@ _syscall1(int, delete_module, const char *, name)
 
 extern int rmmod_main(int argc, char **argv)
 {
-       int ret = TRUE;
+       int ret = EXIT_SUCCESS;
        if (argc <= 1) {
                usage(rmmod_usage);
        }
@@ -47,9 +47,9 @@ extern int rmmod_main(int argc, char **argv)
                                /* Unload _all_ unused modules via NULL delete_module() call */
                                if (delete_module(NULL)) {
                                        perror("rmmod");
-                                       exit(FALSE);
+                                       return EXIT_FAILURE;
                                }
-                               exit(TRUE);
+                               return EXIT_SUCCESS;
                        default:
                                usage(rmmod_usage);
                        }
@@ -59,7 +59,7 @@ extern int rmmod_main(int argc, char **argv)
        while (argc-- > 0) {
                if (delete_module(*argv) < 0) {
                        perror(*argv);
-                       ret=FALSE;
+                       ret = EXIT_FAILURE;
                }
                argv++;
        }
index 63c1063..6a31e04 100644 (file)
@@ -68,5 +68,5 @@ setkeycodes_main(int argc, char** argv)
        argc -= 2;
        argv += 2;
     }
-    return( TRUE);
+       return EXIT_SUCCESS;
 }
diff --git a/sh.c b/sh.c
index 461f2c0..1524ef1 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk)
                newdir = cmd->progs[0].argv[1];
        if (chdir(newdir)) {
                printf("cd: %s: %s\n", newdir, strerror(errno));
-               return FALSE;
+               return EXIT_FAILURE;
        }
        getcwd(cwd, sizeof(char)*MAX_LINE);
 
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'env' handler */
@@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk)
                fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
                                strerror(errno));
        }
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'exit' handler */
 static int builtin_exit(struct job *cmd, struct jobSet *junk)
 {
        if (!cmd->progs[0].argv[1] == 1)
-               exit TRUE;
+               exit(EXIT_SUCCESS);
 
        exit (atoi(cmd->progs[0].argv[1]));
 }
@@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
                if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
                        errorMsg("%s: exactly one argument is expected\n",
                                        cmd->progs[0].argv[0]);
-                       return FALSE;
+                       return EXIT_FAILURE;
                }
                if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
                        errorMsg("%s: bad argument '%s'\n",
                                        cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
-                       return FALSE;
+                       return EXIT_FAILURE;
                        for (job = jobList->head; job; job = job->next) {
                                if (job->jobId == jobNum) {
                                        break;
@@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
        if (!job) {
                errorMsg("%s: unknown job %d\n",
                                cmd->progs[0].argv[0], jobNum);
-               return FALSE;
+               return EXIT_FAILURE;
        }
 
        if (*cmd->progs[0].argv[0] == 'f') {
@@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
 
        job->stoppedProgs = 0;
 
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'help' handler */
@@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk)
                fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
        }
        fprintf(stdout, "\n\n");
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'jobs' handler */
@@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList)
 
                printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
        }
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 
@@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk)
 {
        getcwd(cwd, sizeof(char)*MAX_LINE);
        fprintf(stdout, "%s\n", cwd);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'export VAR=value' handler */
@@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk)
 
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `then'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* If the if result was FALSE, skip the 'then' stuff */
        if (cmd->jobContext & IF_FALSE_CONTEXT) {
-               return TRUE;
+               return EXIT_SUCCESS;
        }
 
        cmd->jobContext |= THEN_EXP_CONTEXT;
@@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk)
 
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `else'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* If the if result was TRUE, skip the 'else' stuff */
        if (cmd->jobContext & IF_TRUE_CONTEXT) {
-               return TRUE;
+               return EXIT_SUCCESS;
        }
 
        cmd->jobContext |= ELSE_EXP_CONTEXT;
@@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk)
 {
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `fi'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* Clear out the if and then context bits */
        cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
        debug_printf(stderr, "Hit an fi   -- jobContext=%d\n", cmd->jobContext);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 #endif
 
@@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk)
        int status;
 
        if (!cmd->progs[0].argv[1] == 1)
-               return FALSE;
+               return EXIT_FAILURE;
 
        input = fopen(cmd->progs[0].argv[1], "r");
        if (!input) {
                fprintf(stdout, "Couldn't open file '%s'\n",
                                cmd->progs[0].argv[1]);
-               return FALSE;
+               return EXIT_FAILURE;
        }
 
        /* Now run the file */
@@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk)
 {
        if (!cmd->progs[0].argv[1] == 1) {
                fprintf(stdout, "unset: parameter required.\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        unsetenv(cmd->progs[0].argv[1]);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* free up all memory from a job */
index 8115e52..94b8fc7 100644 (file)
@@ -135,7 +135,7 @@ void clean_up_and_die(int sig)
        cmdedit_reset_term();
        fprintf(stdout, "\n");
        if (sig!=SIGINT)
-               exit(TRUE);
+               exit(EXIT_SUCCESS);
 }
 
 /* Go to HOME position */
index 461f2c0..1524ef1 100644 (file)
@@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk)
                newdir = cmd->progs[0].argv[1];
        if (chdir(newdir)) {
                printf("cd: %s: %s\n", newdir, strerror(errno));
-               return FALSE;
+               return EXIT_FAILURE;
        }
        getcwd(cwd, sizeof(char)*MAX_LINE);
 
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'env' handler */
@@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk)
                fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
                                strerror(errno));
        }
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'exit' handler */
 static int builtin_exit(struct job *cmd, struct jobSet *junk)
 {
        if (!cmd->progs[0].argv[1] == 1)
-               exit TRUE;
+               exit(EXIT_SUCCESS);
 
        exit (atoi(cmd->progs[0].argv[1]));
 }
@@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
                if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
                        errorMsg("%s: exactly one argument is expected\n",
                                        cmd->progs[0].argv[0]);
-                       return FALSE;
+                       return EXIT_FAILURE;
                }
                if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
                        errorMsg("%s: bad argument '%s'\n",
                                        cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
-                       return FALSE;
+                       return EXIT_FAILURE;
                        for (job = jobList->head; job; job = job->next) {
                                if (job->jobId == jobNum) {
                                        break;
@@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
        if (!job) {
                errorMsg("%s: unknown job %d\n",
                                cmd->progs[0].argv[0], jobNum);
-               return FALSE;
+               return EXIT_FAILURE;
        }
 
        if (*cmd->progs[0].argv[0] == 'f') {
@@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
 
        job->stoppedProgs = 0;
 
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'help' handler */
@@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk)
                fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
        }
        fprintf(stdout, "\n\n");
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'jobs' handler */
@@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList)
 
                printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
        }
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 
@@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk)
 {
        getcwd(cwd, sizeof(char)*MAX_LINE);
        fprintf(stdout, "%s\n", cwd);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* built-in 'export VAR=value' handler */
@@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk)
 
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `then'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* If the if result was FALSE, skip the 'then' stuff */
        if (cmd->jobContext & IF_FALSE_CONTEXT) {
-               return TRUE;
+               return EXIT_SUCCESS;
        }
 
        cmd->jobContext |= THEN_EXP_CONTEXT;
@@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk)
 
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `else'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* If the if result was TRUE, skip the 'else' stuff */
        if (cmd->jobContext & IF_TRUE_CONTEXT) {
-               return TRUE;
+               return EXIT_SUCCESS;
        }
 
        cmd->jobContext |= ELSE_EXP_CONTEXT;
@@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk)
 {
        if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
                errorMsg("unexpected token `fi'\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        /* Clear out the if and then context bits */
        cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
        debug_printf(stderr, "Hit an fi   -- jobContext=%d\n", cmd->jobContext);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 #endif
 
@@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk)
        int status;
 
        if (!cmd->progs[0].argv[1] == 1)
-               return FALSE;
+               return EXIT_FAILURE;
 
        input = fopen(cmd->progs[0].argv[1], "r");
        if (!input) {
                fprintf(stdout, "Couldn't open file '%s'\n",
                                cmd->progs[0].argv[1]);
-               return FALSE;
+               return EXIT_FAILURE;
        }
 
        /* Now run the file */
@@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk)
 {
        if (!cmd->progs[0].argv[1] == 1) {
                fprintf(stdout, "unset: parameter required.\n");
-               return FALSE;
+               return EXIT_FAILURE;
        }
        unsetenv(cmd->progs[0].argv[1]);
-       return TRUE;
+       return EXIT_SUCCESS;
 }
 
 /* free up all memory from a job */
diff --git a/sleep.c b/sleep.c
index 709e3de..ad92b10 100644 (file)
--- a/sleep.c
+++ b/sleep.c
@@ -32,7 +32,7 @@ extern int sleep_main(int argc, char **argv)
 
        if (sleep(atoi(*(++argv))) != 0) {
                perror("sleep");
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 4a1c8f9..0ae0c36 100644 (file)
@@ -50,7 +50,7 @@ static void swap_enable_disable(char *device)
 
        if (status != 0) {
                perror(applet_name);
-               exit(FALSE);
+               exit(EXIT_FAILURE);
        }
 }
 
@@ -69,7 +69,7 @@ static void do_em_all()
                }
        }
        endmntent(f);
-       exit(TRUE);
+       exit(EXIT_SUCCESS);
 }
 
 
@@ -105,9 +105,8 @@ extern int swap_on_off_main(int argc, char **argv)
                        }
        }
        swap_enable_disable(*argv);
-       exit(TRUE);
+       return EXIT_SUCCESS;
 
   usage_and_exit:
        usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage);
-       exit(FALSE);
 }
index 9bedc84..a507158 100644 (file)
@@ -568,7 +568,7 @@ extern int syslogd_main(int argc, char **argv)
                doSyslogd();
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /*
index 9bedc84..a507158 100644 (file)
--- a/syslogd.c
+++ b/syslogd.c
@@ -568,7 +568,7 @@ extern int syslogd_main(int argc, char **argv)
                doSyslogd();
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /*
diff --git a/tar.c b/tar.c
index 826ab96..01997e4 100644 (file)
--- a/tar.c
+++ b/tar.c
@@ -156,6 +156,7 @@ extern int tar_main(int argc, char **argv)
        int tostdoutFlag = FALSE;
        int firstOpt = TRUE;
        int stopIt;
+       int status;
                                                                                                                                                   
 
        if (argc <= 1)
@@ -227,16 +228,21 @@ extern int tar_main(int argc, char **argv)
 #ifndef BB_FEATURE_TAR_CREATE
                fatalError( "This version of tar was not compiled with tar creation support.\n");
 #else
-               exit(writeTarFile(tarName, verboseFlag, argv, excludeList));
+               status = writeTarFile(tarName, verboseFlag, argv, excludeList);
 #endif
        }
        if (listFlag == TRUE || extractFlag == TRUE) {
                if (*argv)
                        extractList = argv;
-               exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
-                                       verboseFlag, extractList, excludeList));
+               status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
+                                       verboseFlag, extractList, excludeList);
        }
 
+       if (status == TRUE)
+               return EXIT_SUCCESS;
+       else
+               return EXIT_FAILURE;
+
   flagError:
        fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
 }
diff --git a/touch.c b/touch.c
index 7db6c6e..5537fb6 100644 (file)
--- a/touch.c
+++ b/touch.c
@@ -43,7 +43,6 @@ extern int touch_main(int argc, char **argv)
                                break;
                        default:
                                usage(touch_usage);
-                               exit(FALSE);
                        }
                }
        }
@@ -57,7 +56,7 @@ extern int touch_main(int argc, char **argv)
                                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                if (fd < 0) {
                        if (create == FALSE && errno == ENOENT)
-                               exit(TRUE);
+                               return EXIT_SUCCESS;
                        else {
                                fatalError("%s", strerror(errno));
                        }
@@ -70,5 +69,5 @@ extern int touch_main(int argc, char **argv)
                argv++;
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index b3b221e..333541c 100644 (file)
 
 extern int true_main(int argc, char **argv)
 {
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 extern int false_main(int argc, char **argv)
 {
-       return(FALSE);
+       return EXIT_FAILURE;
 }
diff --git a/tty.c b/tty.c
index 6eebed9..46201d3 100644 (file)
--- a/tty.c
+++ b/tty.c
@@ -38,5 +38,5 @@ extern int tty_main(int argc, char **argv)
                else
                        puts("not a tty");
        }
-       return(isatty(0) ? TRUE : FALSE);
+       return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE);
 }
index 1d9c6bb..5f3e59c 100644 (file)
--- a/umount.c
+++ b/umount.c
@@ -273,11 +273,14 @@ extern int umount_main(int argc, char **argv)
 
        mtab_read();
        if (umountAll == TRUE) {
-               exit(umount_all(useMtab));
+               if (umount_all(useMtab) == TRUE)
+                       return EXIT_SUCCESS;
+               else
+                       return EXIT_FAILURE;
        }
        if (do_umount(*argv, useMtab) == 0)
-               exit(TRUE);
+               return EXIT_SUCCESS;
        perror("umount");
-       return(FALSE);
+       return EXIT_FAILURE;
 }
 
diff --git a/uname.c b/uname.c
index 8d9427c..2781b80 100644 (file)
--- a/uname.c
+++ b/uname.c
@@ -138,7 +138,7 @@ int uname_main(int argc, char **argv)
        print_element(PRINT_MACHINE, name.machine);
        print_element(PRINT_PROCESSOR, processor);
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /* If the name element set in MASK is selected for printing in `toprint',
index 7279d83..080cb99 100644 (file)
--- a/update.c
+++ b/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;
 }
 
 /*
index fe4e48c..159f24b 100644 (file)
--- a/uptime.c
+++ b/uptime.c
@@ -70,5 +70,5 @@ extern int uptime_main(int argc, char **argv)
                        LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), 
                        LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 69790ef..86dc050 100644 (file)
--- a/usleep.c
+++ b/usleep.c
@@ -32,5 +32,5 @@ extern int usleep_main(int argc, char **argv)
        }
 
        usleep(atoi(*(++argv)));        /* return void */
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 88b5d13..a32ca79 100644 (file)
@@ -73,7 +73,7 @@ int dmesg_main(int argc, char **argv)
                if (n < 0) {
                        goto klogctl_error;
                }
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 
        if (bufsize < 4096)
@@ -98,11 +98,11 @@ int dmesg_main(int argc, char **argv)
        }
        if (lastc != '\n')
                putchar('\n');
-       exit(TRUE);
+       return EXIT_SUCCESS;
   end:
        usage(dmesg_usage);
-       exit(FALSE);
+       return EXIT_FAILURE;
   klogctl_error:
        perror("klogctl");
-       return(FALSE);
+       return EXIT_FAILURE;
 }
index 8307f26..47130e3 100644 (file)
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
        if (g_options & OPT_READMODE) {
                if (!readmode(&var, modefile, mode)) {
                        errorMsg("Unknown video mode `%s'\n", mode);
-                       exit(1);
+                       return EXIT_FAILURE;
                }
        }
 
@@ -446,5 +446,5 @@ extern int fbset_main(int argc, char **argv)
        /* Don't close the file, as exiting will take care of that */
        /* close(fh); */
 
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index 6633e12..380015d 100644 (file)
@@ -40,7 +40,7 @@ extern int fdflush_main(int argc, char **argv)
        fd = open(*argv, 0);
        if (fd < 0) {
                perror(*argv);
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
        value = ioctl(fd, FDFLUSH, 0);
@@ -50,7 +50,7 @@ extern int fdflush_main(int argc, char **argv)
 
        if (value) {
                perror(*argv);
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 22fc3e6..5671514 100644 (file)
@@ -51,7 +51,7 @@ freeramdisk_main(int argc, char **argv)
        /* Don't bother closing.  Exit does
         * that, so we can save a few bytes */
        /* close(f); */
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /*
index 627d04f..4757e15 100644 (file)
@@ -176,7 +176,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr)
 void die(const char *str)
 {
        errorMsg("%s\n", str);
-       exit(FALSE);
+       exit(EXIT_FAILURE);
 }
 
 void page_ok(int page)
@@ -325,7 +325,7 @@ int mkswap_main(int argc, char **argv)
        } else if (PAGES > sz && !force) {
                errorMsg("error: size %ld is larger than device size %d\n",
                                PAGES * (pagesize / 1024), sz * (pagesize / 1024));
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
 
        if (version == -1) {
@@ -369,7 +369,7 @@ int mkswap_main(int argc, char **argv)
        DEV = open(device_name, O_RDWR);
        if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
                perror(device_name);
-               exit(FALSE);
+               return EXIT_FAILURE;
        }
        if (!S_ISBLK(statbuf.st_mode))
                check = 0;
@@ -393,7 +393,7 @@ int mkswap_main(int argc, char **argv)
 "This probably means creating v0 swap would destroy your partition table\n"
 "No swap created. If you really want to create swap v0 on that device, use\n"
 "the -f option to force it.\n", device_name);
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
                }
        }
@@ -429,5 +429,5 @@ int mkswap_main(int argc, char **argv)
         */
        if (fsync(DEV))
                die("fsync failed");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 8b115c9..34dbb5e 100644 (file)
@@ -330,7 +330,7 @@ extern int mount_main(int argc, char **argv)
        int fakeIt = FALSE;
        int useMtab = TRUE;
        int i;
-       int rc = FALSE;
+       int rc = EXIT_FAILURE;
        int fstabmount = FALSE; 
 
 #if defined BB_FEATURE_USE_DEVPS_PATCH
@@ -367,7 +367,7 @@ extern int mount_main(int argc, char **argv)
                free( mntentlist);
                close(fd);
 #endif
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 #else
        if (argc == 1) {
@@ -388,7 +388,7 @@ extern int mount_main(int argc, char **argv)
                } else {
                        perror(mtab_file);
                }
-               exit(TRUE);
+               return EXIT_SUCCESS;
        }
 #endif
 
@@ -489,7 +489,7 @@ singlemount:
                                        &extra_opts, &string_flags, 1);
                                if ( rc != 0) {
                                        fatalError("nfsmount failed: %s\n", strerror(errno));   
-                                       rc = FALSE;
+                                       rc = EXIT_FAILURE;
                                }
                        }
 #endif
@@ -499,7 +499,7 @@ singlemount:
                        if (all == FALSE)
                                break;
 
-                       rc = TRUE;      // Always return 0 for 'all'
+                       rc = EXIT_SUCCESS;      // Always return 0 for 'all'
                }
                if (fstabmount == TRUE)
                        endmntent(f);
@@ -512,8 +512,6 @@ singlemount:
        
        goto singlemount;
        
-       exit(FALSE);
-
 goodbye:
        usage(mount_usage);
 }
index 80b37de..7c8d541 100644 (file)
@@ -101,7 +101,6 @@ int rdate_main(int argc, char **argv)
                        default:
                        case 'H':
                                usage(rdate_usage);
-                               return(FALSE);
                                break;
                        case 's':
                                setdate++;
@@ -117,11 +116,10 @@ int rdate_main(int argc, char **argv)
 
        if (optind == argc) {
                usage(rdate_usage);
-               return(FALSE);
        }
 
        if ((time= askremotedate(argv[optind])) == (time_t)-1) {
-               return(FALSE);
+               return EXIT_FAILURE;
        }
        if (setdate) {
                if (stime(&time) < 0)
@@ -131,5 +129,5 @@ int rdate_main(int argc, char **argv)
                fprintf(stdout, "%s", ctime(&time));
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 4a1c8f9..0ae0c36 100644 (file)
@@ -50,7 +50,7 @@ static void swap_enable_disable(char *device)
 
        if (status != 0) {
                perror(applet_name);
-               exit(FALSE);
+               exit(EXIT_FAILURE);
        }
 }
 
@@ -69,7 +69,7 @@ static void do_em_all()
                }
        }
        endmntent(f);
-       exit(TRUE);
+       exit(EXIT_SUCCESS);
 }
 
 
@@ -105,9 +105,8 @@ extern int swap_on_off_main(int argc, char **argv)
                        }
        }
        swap_enable_disable(*argv);
-       exit(TRUE);
+       return EXIT_SUCCESS;
 
   usage_and_exit:
        usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage);
-       exit(FALSE);
 }
index 1d9c6bb..5f3e59c 100644 (file)
@@ -273,11 +273,14 @@ extern int umount_main(int argc, char **argv)
 
        mtab_read();
        if (umountAll == TRUE) {
-               exit(umount_all(useMtab));
+               if (umount_all(useMtab) == TRUE)
+                       return EXIT_SUCCESS;
+               else
+                       return EXIT_FAILURE;
        }
        if (do_umount(*argv, useMtab) == 0)
-               exit(TRUE);
+               return EXIT_SUCCESS;
        perror("umount");
-       return(FALSE);
+       return EXIT_FAILURE;
 }
 
index 78ca096..825fdb5 100644 (file)
@@ -294,16 +294,16 @@ int uudecode_main (int argc,
   }
 
   if (optind == argc)
-    exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE;
+    exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
   else {
-    exit_status = TRUE;
+    exit_status = EXIT_SUCCESS;
     do {
       if (freopen (argv[optind], "r", stdin) != NULL) {
         if (decode (argv[optind], outname) != 0)
           exit_status = FALSE;
       } else {
         errorMsg("%s: %s\n", argv[optind], strerror(errno));
-        exit_status = FALSE;
+        exit_status = EXIT_FAILURE;
       }
       optind++;
     }
index aea99ed..8d15adb 100644 (file)
@@ -179,7 +179,7 @@ int uuencode_main (int argc,
     /* Optional first argument is input file.  */
     if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
       errorMsg("%s: %s\n", argv[optind], strerror(errno));
-      exit FALSE;
+      return EXIT_FAILURE;
     }
     mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
     optind++;
@@ -200,9 +200,9 @@ int uuencode_main (int argc,
   printf(trans_ptr == uu_std ? "end\n" : "====\n");
   if (ferror (stdout)) {
     errorMsg("Write error\n");
-    exit FALSE;
+    return EXIT_FAILURE;
   }
-  return( TRUE);
+  return EXIT_SUCCESS;
 }
 
 /* Copyright (c) 1983 Regents of the University of California.