Stop using TRUE and FALSE for exit status.
authorMatt Kraai <kraai@debian.org>
Fri, 1 Dec 2000 02:55:13 +0000 (02:55 -0000)
committerMatt Kraai <kraai@debian.org>
Fri, 1 Dec 2000 02:55:13 +0000 (02:55 -0000)
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 f3ba59b6a4978bddb7a75f4aa0e4503851e6505e..0f16ec88cf097f888c92f28e4802e0f2ee86ed18 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 f3ba59b6a4978bddb7a75f4aa0e4503851e6505e..0f16ec88cf097f888c92f28e4802e0f2ee86ed18 100644 (file)
@@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv)
                }
                extractList=extractList->next;
        }
-       return (TRUE);
+       return EXIT_SUCCESS;
 }
index 70b25bdb073e549bb39e5c54d8222bb93afe25ce..eeff9774ad3c1f8022c4c5b68065b56febcfaa07 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 2e147b1ca2f0918206c09b91db7c034ceff7adfb..d8c22a924f37cabd159c9ed326df2e4d0c673299 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 826ab96653f1451915a5af4ca2cbdee14982ec11..01997e4643a5e70664ad760640a43357c5d75bcb 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 4d9fc4ec0c90107bef321a5037db557c2f1e7d9c..fcc7d4619ec458fbbddaf88e63605aa385f3d78b 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 1ec7eec6cda20fdc7ace6909fcd6dc72ba9eb705..e8ccb8156974e9c62acced52b92d4d2e9812b329 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 f0a298104fc6d39c3806da358fcc6029467bd3cc..f279af18d96b2ea226e783a35235cbbfa889cdc2 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 d4b16a05dab0e328198f8f9dc7e4995eea093cea..7909645868c05a867ca8a7055c6f48e9dc2f198d 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 4a8e0450fbf13827437b5cf00649dadeeac4fa33..ca83f3820e9b0543b73b4a773dc6925190150c85 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 8115e5259735e0158fcf412d5dd1c773ee5364b1..94b8fc7b17801858056dbb618c6f0b2871632e8d 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 98b747eedb0f2c1a58649d23cb74faf42f84336a..6b955447c0192b453bf437aae724a9ac1d86a0b5 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 d4b16a05dab0e328198f8f9dc7e4995eea093cea..7909645868c05a867ca8a7055c6f48e9dc2f198d 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 4a8e0450fbf13827437b5cf00649dadeeac4fa33..ca83f3820e9b0543b73b4a773dc6925190150c85 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 65af79b7791dfc8ed7b06009bcd5bec499452d1a..4600c0d053bc8f9c4d55ae1df2b892183e9db51a 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 2d989dfc499f83243d5eb1147848a9c48075480c..77689fc84602a623c03ff3464eb641d280158910 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 f57737925291dd4345891c26c72434b73751f80b..1562108908879359b6bd5cae9b05d194b38a2f80 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 8e2c491e2a8aad1a184f9a792fc42a230fb6c8ef..bf8c3ed45e71ac490582e0c4f8fe0b02e8ed4eb0 100644 (file)
@@ -29,6 +29,6 @@
 extern int reset_main(int argc, char **argv)
 {
        printf("\033c");
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
index 63c1063330fb70e1d2c1a70cb6760426b6be8d2c..6a31e042afea5ed5f0eab710e8dfde829f77aabf 100644 (file)
@@ -68,5 +68,5 @@ setkeycodes_main(int argc, char** argv)
        argc -= 2;
        argv += 2;
     }
-    return( TRUE);
+       return EXIT_SUCCESS;
 }
index 4d9fc4ec0c90107bef321a5037db557c2f1e7d9c..fcc7d4619ec458fbbddaf88e63605aa385f3d78b 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 f0a298104fc6d39c3806da358fcc6029467bd3cc..f279af18d96b2ea226e783a35235cbbfa889cdc2 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 98b747eedb0f2c1a58649d23cb74faf42f84336a..6b955447c0192b453bf437aae724a9ac1d86a0b5 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 2d313cc2467fddc6c0567fd7d82b3780d866241e..b281fa234f3971644d01f4bbe64c40b0c204cee2 100644 (file)
@@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv)
                }
        }
 
-       return 0;
+       return EXIT_SUCCESS;
 }
index 7e421676884ba0aa12817d7129f3f47800f5d9a3..2e69bde4a96afc80e2311dc597ad9ff422d251c1 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 2b77ea6a587a6882275f54310fa869eecd8f573f..044f167c336c452ccae94d36dda38d04b5880f52 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 8d6242c56c88cb08259eb28d71f5337b6692ded3..aefffc771ab840a77fcc0db1bbf50f33be87921e 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 23f46be4085e842b7b76b131188a2bca1cd87655..ceb750cb8a81093af6c3442b921281919a7f89a6 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 c9f783f1a6c5e675f55827e1ca491eaf7a5560cd..ed2088e4e298efa5379e0f7d6697aa0be9ba449f 100644 (file)
@@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) {
                 putchar(c);
                 c = getchar();
        } 
-       return 0;
+       return EXIT_SUCCESS;
 }
index 408ad994cc626c41f3be8e458c14945ae5c4addf..a0f1606fe8dc2c5cc497f90143e53da8cb427ea3 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 a6b5152d8bfbf496d84492beba695e72b17ba3e1..393f4425f5a86244d3fe12b1d1947e8b47a4a176 100644 (file)
@@ -107,7 +107,7 @@ just_echo:
                putchar('\n');
        fflush(stdout);
 
-       return 0;
+       return EXIT_SUCCESS;
 }
 
 /*-
index 47bd8d724815f13c377976d1281a6a688f70615f..35a5859c4e3b59130159638cffe87b71b369a4a7 100644 (file)
@@ -26,5 +26,5 @@
 extern int hostid_main(int argc, char **argv)
 {
        printf("%lx\n", gethostid());
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 14d15c81c5f615ec8744dfc4d93a8996460e41c1..1ab4e3a58d0bcf639f1cf3cdbffb0f6080607849 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 d508a1bfe5ea8040836de69fb661956923e2614b..225132ba4dc2fa495901fb392dbc286948597dca 100644 (file)
@@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv)
 
   print_usage_message:
        usage(ls_usage);
-       return(FALSE);
 }
index 21570de9352ac8d12cded756e0e987a74f57985c..30b882ab55d8e29f56187344a07a7fe86d7c55bf 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 04310e4c78a3e90b10f4f0700f6d6aaf7b73e2e2..c950847dc34bcb8b8e1d64b2c18357768a1bfc44 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 5e1bc1a78fc10bbbee448e94931d6da9e70a6871..ef4a5256f4ec0327469160ea58eb128c732d7771 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 ecb0e4780643f33511e6a8aed13de3bef82e865a..21b2689ccae64e477c2883d253ad1a1c89b2915a 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 c9de7778eec0765c75a1da43a1d2e4a553b560b9..54129b1755f015f4761729b9f1afa89c160b47e6 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 4f97cad23e505aa731f22bb4ad34b7854d754731..c62083e9b940603088af0b7ea0e2efa46e62b687 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 709e3de34b7a2527b1efe26838ba956bc2890d55..ad92b106d36abdb30ed5f8c3bc9a50e40e85585c 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 7db6c6e3383ab2156d6c1569174a44b5cc28d3e3..5537fb63bfec60f2107d13498ea4e771358cf552 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 6eebed9fbc3a444e62d00c8253c07949e219fb78..46201d3e6e65a5fe24636ac0981a7b1f92533aaa 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 8d9427c8649c82a50ce296e9352c39b41e534eab..2781b80b3c82a5962b3b93b423bdf07d3db15ce7 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 69790ef090bc6efc6882b4633c5e14bb341fc241..86dc0501b71b41b0448037744dfa36b5bc6ccba2 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 78ca0968d870d5627018ea6c6f678e4e96d0d95f..825fdb5622398bbcc826a2aa82187664f3d5e4dc 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 aea99ed87f4c7307919080e1bd456ec62ff29d19..8d15adbf6d87b58d9303cfd642401303c91d506f 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 2257f44220cacdd5135df6bf4c021ed02f530baf..580c92046ed539b35113746986b5cf4af59b3909 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 2d313cc2467fddc6c0567fd7d82b3780d866241e..b281fa234f3971644d01f4bbe64c40b0c204cee2 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 7e421676884ba0aa12817d7129f3f47800f5d9a3..2e69bde4a96afc80e2311dc597ad9ff422d251c1 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 48aa830d6117ffb676c00be3910ae79f05afd5ca..0f5f1fc77a6a6589fa671d3bd3c8af3970f62106 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 2b77ea6a587a6882275f54310fa869eecd8f573f..044f167c336c452ccae94d36dda38d04b5880f52 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 65af79b7791dfc8ed7b06009bcd5bec499452d1a..4600c0d053bc8f9c4d55ae1df2b892183e9db51a 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 8d6242c56c88cb08259eb28d71f5337b6692ded3..aefffc771ab840a77fcc0db1bbf50f33be87921e 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 23f46be4085e842b7b76b131188a2bca1cd87655..ceb750cb8a81093af6c3442b921281919a7f89a6 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 88b5d13930bb3dcd232ffa63fbdb65ab263a2b2a..a32ca79dccfc4815e13bfdb7d7ae133968481240 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 c9f783f1a6c5e675f55827e1ca491eaf7a5560cd..ed2088e4e298efa5379e0f7d6697aa0be9ba449f 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 408ad994cc626c41f3be8e458c14945ae5c4addf..a0f1606fe8dc2c5cc497f90143e53da8cb427ea3 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 2d989dfc499f83243d5eb1147848a9c48075480c..77689fc84602a623c03ff3464eb641d280158910 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 cf5f1cff802871be7a0710cf8be14f6534f39b23..03d80d87d4b56f33e3a9a6c771f4903e356fa230 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 a6b5152d8bfbf496d84492beba695e72b17ba3e1..393f4425f5a86244d3fe12b1d1947e8b47a4a176 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 8307f262d66339651ae3171a77907f15a5421f4b..47130e355bb24284f8bfd1a7c0beae0c2eeb0c84 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 6633e12128a922b8d488b5c71c13371fc813226b..380015ddec2567f8b46e8de383e37c160ace3443 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 48faf2c30bcf3bd6601fd9d3a47e11691c615a8d..a86b07e73534ab5e9eea10a5d0f115bee8b1fda4 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 48faf2c30bcf3bd6601fd9d3a47e11691c615a8d..a86b07e73534ab5e9eea10a5d0f115bee8b1fda4 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 a33fa9a596c4d3b982b5a5df7dfe6e5f5939b7ff..f2e746e396e21f57457a6920b16862cbd4a51d63 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 22fc3e643ee61f5c5928791c772a27aa8e386b57..567151455470e00ee6e49f7dcbfe2c2d9d930b1e 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 70b25bdb073e549bb39e5c54d8222bb93afe25ce..eeff9774ad3c1f8022c4c5b68065b56febcfaa07 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 2e147b1ca2f0918206c09b91db7c034ceff7adfb..d8c22a924f37cabd159c9ed326df2e4d0c673299 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 47bd8d724815f13c377976d1281a6a688f70615f..35a5859c4e3b59130159638cffe87b71b369a4a7 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 4f96c950e1393d80553d4fba6a42d0705ae6e1c0..6386b9407d5ab98775bac3a6efaddfa9076165fb 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 7ade8228c0a8b7ac1991bc89c82cb242a4635fa6..dd5ca49fa8a2662849b2746c45df99bbc9b33c67 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 461f2c0920e3f92c38891e147a001a26e4140713..1524ef16b8532be73782679157c8f2e7264dafc3 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 14d15c81c5f615ec8744dfc4d93a8996460e41c1..1ab4e3a58d0bcf639f1cf3cdbffb0f6080607849 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 f57737925291dd4345891c26c72434b73751f80b..1562108908879359b6bd5cae9b05d194b38a2f80 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 d508a1bfe5ea8040836de69fb661956923e2614b..225132ba4dc2fa495901fb392dbc286948597dca 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 21570de9352ac8d12cded756e0e987a74f57985c..30b882ab55d8e29f56187344a07a7fe86d7c55bf 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 48aa830d6117ffb676c00be3910ae79f05afd5ca..0f5f1fc77a6a6589fa671d3bd3c8af3970f62106 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 cf5f1cff802871be7a0710cf8be14f6534f39b23..03d80d87d4b56f33e3a9a6c771f4903e356fa230 100644 (file)
@@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv)
                ut.ut_addr);
        }
 #endif
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
index 62ca870c5a2f91e9b49185da05be4bde72e56a2e..2d53cc2a4f2a555afa40935c448976da1ce89cef 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 6acae4ea1f846bcffd11f92cec56fc2c2a54e149..583674b18afcea1f4d6e92d5b9de95023bd68aac 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 7279d83a87981c3d47ddd370c76b597d41080600..080cb99c31dff71ea57ee13717b0f9371363801e 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 04310e4c78a3e90b10f4f0700f6d6aaf7b73e2e2..c950847dc34bcb8b8e1d64b2c18357768a1bfc44 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 5e1bc1a78fc10bbbee448e94931d6da9e70a6871..ef4a5256f4ec0327469160ea58eb128c732d7771 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 ecb0e4780643f33511e6a8aed13de3bef82e865a..21b2689ccae64e477c2883d253ad1a1c89b2915a 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 627d04f6074102d75b183c38dca3c830257b70e8..4757e15f83761105e39fd09ef9e44e4844f7d772 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 62ca870c5a2f91e9b49185da05be4bde72e56a2e..2d53cc2a4f2a555afa40935c448976da1ce89cef 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 4f96c950e1393d80553d4fba6a42d0705ae6e1c0..6386b9407d5ab98775bac3a6efaddfa9076165fb 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 dd293523d675b04ed6a9662b36ebfeefe8594023..f5d7d359a2f889521e1814dabf4d30b68e6a8c79 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 8b115c9f59db32503668a580fc0c99e0f3c7e7ea..34dbb5eee474a12bdc1dc4d1828e5f68c1482532 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 6acae4ea1f846bcffd11f92cec56fc2c2a54e149..583674b18afcea1f4d6e92d5b9de95023bd68aac 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 acb3e3bb2718dd58dde41c688dda785d2eb3359a..c46a0b8ea610d541d69cc0592c3d91ab5dfc0ab6 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 a4363098e6e341fede7a4b8727667fe6944f1edd..af109cf0a9a84b6b3952788a05d1561f4c5a097d 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 acb3e3bb2718dd58dde41c688dda785d2eb3359a..c46a0b8ea610d541d69cc0592c3d91ab5dfc0ab6 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 a4363098e6e341fede7a4b8727667fe6944f1edd..af109cf0a9a84b6b3952788a05d1561f4c5a097d 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 a33fa9a596c4d3b982b5a5df7dfe6e5f5939b7ff..f2e746e396e21f57457a6920b16862cbd4a51d63 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 7ade8228c0a8b7ac1991bc89c82cb242a4635fa6..dd5ca49fa8a2662849b2746c45df99bbc9b33c67 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 df321612a57924f5f6f95620c4e02c8a2acca820..4998e15b195ce51dc4b3eecc19a17bb632e77355 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 fe4e48cd6106f289264eafa8170232bf67fb3b96..159f24baa8c722e756176a4b5fb90aade956e2d2 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 df321612a57924f5f6f95620c4e02c8a2acca820..4998e15b195ce51dc4b3eecc19a17bb632e77355 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 c9de7778eec0765c75a1da43a1d2e4a553b560b9..54129b1755f015f4761729b9f1afa89c160b47e6 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 80b37de37c9d3303f6fedccf781975dd5cdd2976..7c8d54117efe2667a7e5657d778f143386dfad76 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 8e2c491e2a8aad1a184f9a792fc42a230fb6c8ef..bf8c3ed45e71ac490582e0c4f8fe0b02e8ed4eb0 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 4f97cad23e505aa731f22bb4ad34b7854d754731..c62083e9b940603088af0b7ea0e2efa46e62b687 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 dd293523d675b04ed6a9662b36ebfeefe8594023..f5d7d359a2f889521e1814dabf4d30b68e6a8c79 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 63c1063330fb70e1d2c1a70cb6760426b6be8d2c..6a31e042afea5ed5f0eab710e8dfde829f77aabf 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 461f2c0920e3f92c38891e147a001a26e4140713..1524ef16b8532be73782679157c8f2e7264dafc3 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 8115e5259735e0158fcf412d5dd1c773ee5364b1..94b8fc7b17801858056dbb618c6f0b2871632e8d 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 461f2c0920e3f92c38891e147a001a26e4140713..1524ef16b8532be73782679157c8f2e7264dafc3 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 709e3de34b7a2527b1efe26838ba956bc2890d55..ad92b106d36abdb30ed5f8c3bc9a50e40e85585c 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 4a1c8f93f827cd09e919793f1beaba98bbf19bcb..0ae0c36eeb5354c167ad9f29c4b18c49a51427d9 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 9bedc84f29a7cd71145865f86027b23d9025bc2a..a5071583d07fb22f394d0c96765c567d845f1c46 100644 (file)
@@ -568,7 +568,7 @@ extern int syslogd_main(int argc, char **argv)
                doSyslogd();
        }
 
-       return(TRUE);
+       return EXIT_SUCCESS;
 }
 
 /*
index 9bedc84f29a7cd71145865f86027b23d9025bc2a..a5071583d07fb22f394d0c96765c567d845f1c46 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 826ab96653f1451915a5af4ca2cbdee14982ec11..01997e4643a5e70664ad760640a43357c5d75bcb 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 7db6c6e3383ab2156d6c1569174a44b5cc28d3e3..5537fb63bfec60f2107d13498ea4e771358cf552 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 b3b221e1f92b57b5aa9af1dbc1391fa6f3d1e2b3..333541c9b41e842e5db078c2988969e5e79ad6db 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 6eebed9fbc3a444e62d00c8253c07949e219fb78..46201d3e6e65a5fe24636ac0981a7b1f92533aaa 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 1d9c6bb3202759f9d2002b52b0a10974e373d45e..5f3e59caf68d83a0634cb2baaea045a9e84d92c4 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 8d9427c8649c82a50ce296e9352c39b41e534eab..2781b80b3c82a5962b3b93b423bdf07d3db15ce7 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 7279d83a87981c3d47ddd370c76b597d41080600..080cb99c31dff71ea57ee13717b0f9371363801e 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 fe4e48cd6106f289264eafa8170232bf67fb3b96..159f24baa8c722e756176a4b5fb90aade956e2d2 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 69790ef090bc6efc6882b4633c5e14bb341fc241..86dc0501b71b41b0448037744dfa36b5bc6ccba2 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 88b5d13930bb3dcd232ffa63fbdb65ab263a2b2a..a32ca79dccfc4815e13bfdb7d7ae133968481240 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 8307f262d66339651ae3171a77907f15a5421f4b..47130e355bb24284f8bfd1a7c0beae0c2eeb0c84 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 6633e12128a922b8d488b5c71c13371fc813226b..380015ddec2567f8b46e8de383e37c160ace3443 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 22fc3e643ee61f5c5928791c772a27aa8e386b57..567151455470e00ee6e49f7dcbfe2c2d9d930b1e 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 627d04f6074102d75b183c38dca3c830257b70e8..4757e15f83761105e39fd09ef9e44e4844f7d772 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 8b115c9f59db32503668a580fc0c99e0f3c7e7ea..34dbb5eee474a12bdc1dc4d1828e5f68c1482532 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 80b37de37c9d3303f6fedccf781975dd5cdd2976..7c8d54117efe2667a7e5657d778f143386dfad76 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 4a1c8f93f827cd09e919793f1beaba98bbf19bcb..0ae0c36eeb5354c167ad9f29c4b18c49a51427d9 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 1d9c6bb3202759f9d2002b52b0a10974e373d45e..5f3e59caf68d83a0634cb2baaea045a9e84d92c4 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 78ca0968d870d5627018ea6c6f678e4e96d0d95f..825fdb5622398bbcc826a2aa82187664f3d5e4dc 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 aea99ed87f4c7307919080e1bd456ec62ff29d19..8d15adbf6d87b58d9303cfd642401303c91d506f 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.