Updates to a number of apps to remove warnings/compile errors under libc5.
authorEric Andersen <andersen@codepoet.org>
Mon, 19 Jun 2000 17:25:40 +0000 (17:25 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 19 Jun 2000 17:25:40 +0000 (17:25 -0000)
Tested under both libc5 and libc6 and all seems well with these fixes.
 -Erik

142 files changed:
applets/busybox.c
archival/gunzip.c
archival/gzip.c
basename.c
busybox.c
cat.c
chmod_chown_chgrp.c
chvt.c
clear.c
console-tools/chvt.c
console-tools/clear.c
console-tools/deallocvt.c
console-tools/loadacm.c
console-tools/loadkmap.c
console-tools/setkeycodes.c
coreutils/basename.c
coreutils/cat.c
coreutils/cut.c
coreutils/date.c
coreutils/df.c
coreutils/dirname.c
coreutils/du.c
coreutils/echo.c
coreutils/head.c
coreutils/hostid.c
coreutils/id.c
coreutils/ln.c
coreutils/logname.c
coreutils/mkdir.c
coreutils/mkfifo.c
coreutils/mknod.c
coreutils/pwd.c
coreutils/rm.c
coreutils/rmdir.c
coreutils/sleep.c
coreutils/sort.c
coreutils/sync.c
coreutils/tail.c
coreutils/tee.c
coreutils/test.c
coreutils/touch.c
coreutils/tty.c
coreutils/uname.c
coreutils/uniq.c
coreutils/usleep.c
coreutils/uudecode.c
coreutils/uuencode.c
coreutils/wc.c
coreutils/whoami.c
cp_mv.c
cut.c
date.c
deallocvt.c
df.c
dirname.c
dmesg.c
du.c
dutmp.c
echo.c
editors/sed.c
fbset.c
fdflush.c
find.c
findutils/find.c
findutils/grep.c
findutils/which.c
free.c
freeramdisk.c
grep.c
gunzip.c
gzip.c
halt.c
head.c
hostid.c
hostname.c
id.c
init/halt.c
init/poweroff.c
init/reboot.c
internal.h
lash.c
ln.c
loadacm.c
loadkmap.c
logger.c
logname.c
lsmod.c
math.c
miscutils/dutmp.c
miscutils/mktemp.c
miscutils/mt.c
mkdir.c
mkfifo.c
mknod.c
mkswap.c
mktemp.c
modutils/lsmod.c
modutils/rmmod.c
more.c
mt.c
networking/hostname.c
networking/nslookup.c
nslookup.c
poweroff.c
procps/free.c
procps/ps.c
procps/uptime.c
ps.c
pwd.c
reboot.c
rm.c
rmdir.c
rmmod.c
sed.c
setkeycodes.c
sh.c
shell/lash.c
sleep.c
sort.c
sync.c
sysklogd/logger.c
tail.c
tee.c
test.c
touch.c
true_false.c
tty.c
uname.c
uniq.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/more.c
uudecode.c
uuencode.c
wc.c
which.c
whoami.c

index be9aa3e83875ddb9ea0039c39030e0bd41cef707..191dee13fdc3d2a74d1847488c997f839dd9d843 100644 (file)
@@ -374,18 +374,11 @@ int main(int argc, char **argv)
 
        while (a->name != 0) {
                if (strcmp(name, a->name) == 0) {
-                       int status;
-
-                       status = ((*(a->main)) (argc, argv));
-                       if (status < 0) {
-                               fprintf(stderr, "%s: %s\n", a->name, strerror(errno));
-                       }
-                       fprintf(stderr, "\n");
-                       exit(status);
+                       exit(((*(a->main)) (argc, argv)));
                }
                a++;
        }
-       exit(busybox_main(argc, argv));
+       return(busybox_main(argc, argv));
 }
 
 
@@ -419,11 +412,10 @@ int busybox_main(int argc, char **argv)
                }
                fprintf(stderr, "\n\n");
                exit(-1);
-       } else {
-               /* If we've already been here once, exit now */
-               been_there_done_that = 1;
-               return (main(argc, argv));
        }
+       /* If we've already been here once, exit now */
+       been_there_done_that = 1;
+       return (main(argc, argv));
 }
 
 /*
index 78ee1d3c1526834ce912b9d53590d1342fbd138b..f2bb59dd7262ed568d47c1f3867a40120cf4819a 100644 (file)
@@ -746,7 +746,7 @@ int gunzip_main(int argc, char **argv)
                        exit(FALSE);
                }
        }
-       exit(exit_code);
+       return(exit_code);
 }
 
 
index a971229d33bb5184ff387276fceb69065ee1d9ef..9248cfecd651bb5b19a0d474b4d2d7d90abb0fc5 100644 (file)
@@ -282,8 +282,6 @@ extern int save_orig_name;          /* set if original name must be saved */
 #define WARN(msg) {if (!quiet) fprintf msg ; \
                   if (exit_code == OK) exit_code = WARNING;}
 
-#define do_exit(c) exit(c)
-
 
        /* in zip.c: */
 extern int zip (int in, int out);
@@ -1883,13 +1881,13 @@ int gzip_main(int argc, char **argv)
                inFileNum = open(ifname, O_RDONLY);
                if (inFileNum < 0) {
                        perror(ifname);
-                       do_exit(WARNING);
+                       exit(WARNING);
                }
                /* Get the time stamp on the input file. */
                result = stat(ifname, &statBuf);
                if (result < 0) {
                        perror(ifname);
-                       do_exit(WARNING);
+                       exit(WARNING);
                }
                time_stamp = statBuf.st_ctime;
                ifile_size = statBuf.st_size;
@@ -1923,7 +1921,7 @@ int gzip_main(int argc, char **argv)
 #endif
                if (outFileNum < 0) {
                        perror(ofname);
-                       do_exit(WARNING);
+                       exit(WARNING);
                }
                SET_BINARY_MODE(outFileNum);
                /* Set permissions on the file */
@@ -1948,7 +1946,7 @@ int gzip_main(int argc, char **argv)
                }
        }
 
-       do_exit(exit_code);
+       return(exit_code);
 }
 
 /* trees.c -- output deflated data using Huffman coding
index 78265a5e61bda1eb1252008c1f00df5df02f5f2a..ac371d274490844fcbc6363137c3480c2104a8cd 100644 (file)
@@ -60,6 +60,6 @@ extern int basename_main(int argc, char **argv)
                        s[m-n] = '\0';
        }
        printf("%s\n", s);
-       exit(TRUE);
+       return(TRUE);
 }
 
index be9aa3e83875ddb9ea0039c39030e0bd41cef707..191dee13fdc3d2a74d1847488c997f839dd9d843 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -374,18 +374,11 @@ int main(int argc, char **argv)
 
        while (a->name != 0) {
                if (strcmp(name, a->name) == 0) {
-                       int status;
-
-                       status = ((*(a->main)) (argc, argv));
-                       if (status < 0) {
-                               fprintf(stderr, "%s: %s\n", a->name, strerror(errno));
-                       }
-                       fprintf(stderr, "\n");
-                       exit(status);
+                       exit(((*(a->main)) (argc, argv)));
                }
                a++;
        }
-       exit(busybox_main(argc, argv));
+       return(busybox_main(argc, argv));
 }
 
 
@@ -419,11 +412,10 @@ int busybox_main(int argc, char **argv)
                }
                fprintf(stderr, "\n\n");
                exit(-1);
-       } else {
-               /* If we've already been here once, exit now */
-               been_there_done_that = 1;
-               return (main(argc, argv));
        }
+       /* If we've already been here once, exit now */
+       been_there_done_that = 1;
+       return (main(argc, argv));
 }
 
 /*
diff --git a/cat.c b/cat.c
index 561b24f3f39f44ee12878e2865b059c1d5a597d1..80044346048acdbd8c76030976f823c1feef5dce 100644 (file)
--- a/cat.c
+++ b/cat.c
@@ -61,7 +61,7 @@ extern int cat_main(int argc, char **argv)
                }
                print_file(file);
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
index 1ff4bde73a0a45250acd6ae0c85d2e5ceb5aa477..d3e267827a15506f226fb97d3ad822c2e5dd4de1 100644 (file)
@@ -101,8 +101,8 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
 int chmod_chown_chgrp_main(int argc, char **argv)
 {
        int recursiveFlag = FALSE;
-       char *groupName;
-       char *p;
+       char *groupName=NULL;
+       char *p=NULL;
        const char *appUsage;
 
        whichApp = (strcmp(*argv, "chown") == 0)? 
diff --git a/chvt.c b/chvt.c
index 37fd21ae96634eb4843722cc8c3ccf849676e8cc..45a04397a4c39f3a7a091926310b14fdef6ef54a 100644 (file)
--- a/chvt.c
+++ b/chvt.c
@@ -33,7 +33,7 @@ int chvt_main(int argc, char **argv)
                perror("VT_WAITACTIVE");
                exit(FALSE);
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 
diff --git a/clear.c b/clear.c
index c27787ed3db5e94c2e049ace793b1cf9ecadd486..dba10569190b554d2752a0528c9f3a1423ab48a3 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");
-       exit(TRUE);
+       return(TRUE);
 }
index 37fd21ae96634eb4843722cc8c3ccf849676e8cc..45a04397a4c39f3a7a091926310b14fdef6ef54a 100644 (file)
@@ -33,7 +33,7 @@ int chvt_main(int argc, char **argv)
                perror("VT_WAITACTIVE");
                exit(FALSE);
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 
index c27787ed3db5e94c2e049ace793b1cf9ecadd486..dba10569190b554d2752a0528c9f3a1423ab48a3 100644 (file)
@@ -29,5 +29,5 @@
 extern int clear_main(int argc, char **argv)
 {
        printf("\033[H\033[J");
-       exit(TRUE);
+       return(TRUE);
 }
index a1b8e4eeab85aec712ed0fef134ccc68c0dd81ef..b65f7b098fb8cdfdc26a95b9dbe81cb3f17ec900 100644 (file)
@@ -34,7 +34,7 @@ int deallocvt_main(int argc, char *argv[])
                /* deallocate all unused consoles */
                if (ioctl(fd, VT_DISALLOCATE, 0)) {
                        perror("VT_DISALLOCATE");
-                       exit(1);
+                       exit( FALSE);
                }
        } else
                for (i = 1; i < argc; i++) {
@@ -48,8 +48,8 @@ int deallocvt_main(int argc, char *argv[])
                                perror("VT_DISALLOCATE");
                                fprintf(stderr, "%s: could not deallocate console %d\n",
                                                progname, num);
-                               exit(1);
+                               exit( FALSE);
                        }
                }
-       exit(0);
+       return( TRUE);
 }
index cca5406ee3a7fe4bac9934306599144bdb7a7016..cf393d92ddf495e6fc0cba52700dce844cf8de4b 100644 (file)
@@ -140,10 +140,9 @@ int screen_map_load(int fd, FILE * fp)
                        perror("PIO_SCRNMAP ioctl"), exit(1);
                else
                        return 0;
-       } else {
-               fprintf(stderr, "Error parsing symbolic map\n");
-               exit(1);
        }
+       fprintf(stderr, "Error parsing symbolic map\n");
+       return(1);
 }
 
 
index 99efc510179a1dfa9d8641b2370955e1cb350899..905741467cc33e7371ceb8dffdcc7736b8eec7e3 100644 (file)
@@ -94,5 +94,5 @@ int loadkmap_main(int argc, char **argv)
        /* Don't bother to close files.  Exit does that 
         * automagically, so we can save a few bytes */
        /* close(fd); */
-       exit(TRUE);
+       return(TRUE);
 }
index e933e14bc24440a499e902a2fb21102a2b1c0a9f..9062caf75a0d4afb6b77b3efdf11bd77bcf05393 100644 (file)
@@ -72,5 +72,5 @@ setkeycodes_main(int argc, char** argv)
        argc -= 2;
        argv += 2;
     }
-    exit( TRUE);
+    return( TRUE);
 }
index 78265a5e61bda1eb1252008c1f00df5df02f5f2a..ac371d274490844fcbc6363137c3480c2104a8cd 100644 (file)
@@ -60,6 +60,6 @@ extern int basename_main(int argc, char **argv)
                        s[m-n] = '\0';
        }
        printf("%s\n", s);
-       exit(TRUE);
+       return(TRUE);
 }
 
index 561b24f3f39f44ee12878e2865b059c1d5a597d1..80044346048acdbd8c76030976f823c1feef5dce 100644 (file)
@@ -61,7 +61,7 @@ extern int cat_main(int argc, char **argv)
                }
                print_file(file);
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
index 89a934e76b60fc7d3da3a92d3f32744d7b449751..7b183e8fdedacf209b1b17821cc5fc0415ffd7d1 100644 (file)
@@ -307,7 +307,7 @@ int cut_main(int argc, char **argv)
                cut();
        }
 
-       exit(exit_status);
+       return(exit_status);
 }
 
 /* cut - extract columns from a file or stdin.         Author: Michael J. Holme
index 8e584cecc128b89746807eabdc99e63362c6c4f8..9e8e3f3eb44ba8146c247215ea1906af12600830 100644 (file)
@@ -273,6 +273,5 @@ int date_main(int argc, char **argv)
        strftime(t_buff, 200, date_fmt, &tm_time);
        printf("%s\n", t_buff);
 
-       exit(TRUE);
-
+       return(TRUE);
 }
index 07e61d87d64d354f91848918b4d53ff5d9402182..ba3227f304ee771b828be0257717312ef5fe0afe 100644 (file)
@@ -108,7 +108,7 @@ extern int df_main(int argc, char **argv)
                endmntent(mountTable);
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
index ce3cd6f03d24e7cd4aeb871ec7fddcf03d5b03cf..847842eab02340322abd9ec57c78c50ab35187a4 100644 (file)
@@ -45,5 +45,5 @@ extern int dirname_main(int argc, char **argv)
        if (s && *s)
                *s = '\0';
        printf("%s\n", (s)? *argv : ".");
-       exit(TRUE);
+       return(TRUE);
 }
index 9c699978e7c33c8416042129d12e4d789a06f181..b8e296ddd20f3bea2a1f761c2ebc8a38baf1ea76 100644 (file)
@@ -181,10 +181,10 @@ int du_main(int argc, char **argv)
                }
        }
 
-       exit(0);
+       return(0);
 }
 
-/* $Id: du.c,v 1.19 2000/05/10 05:05:45 erik Exp $ */
+/* $Id: du.c,v 1.20 2000/06/19 17:25:39 andersen Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
index b31f2229bb784e9b3ff39ade751f51ff137c44b7..4659e4bc627f9f07dae50515440fdc1a8489e4dd 100644 (file)
@@ -96,7 +96,7 @@ echo_main(int argc, char** argv)
        if (! nflag)
                putchar('\n');
        fflush(stdout);
-       exit( 0);
+       return( 0);
 }
 
 /*-
index f4ebe05c9a66b27025fd84530e7793d1c7519d81..f42f4837d323a6bddad94ea6cc6cd41a7a7675ea 100644 (file)
@@ -109,7 +109,7 @@ int head_main(int argc, char **argv)
                        }
                }
        }
-       exit(0);
+       return(0);
 }
 
-/* $Id: head.c,v 1.10 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: head.c,v 1.11 2000/06/19 17:25:39 andersen Exp $ */
index 9e503e5984697cfbb497ab9190f2d26ea3489db7..f1010a65d524fa11301801018d22a7138478b3e6 100644 (file)
@@ -26,5 +26,5 @@
 extern int hostid_main(int argc, char **argv)
 {
        printf("%lx\n", gethostid());
-       exit(TRUE);
+       return(TRUE);
 }
index 23bbc16aed7f6884fc309d43edb9ad9cbc7b3ab6..69dfe2658c855a5ef7c0be767ca5c3d64b6b90bd 100644 (file)
@@ -89,7 +89,7 @@ extern int id_main(int argc, char **argv)
                           my_getpwnam(user), user, my_getgrnam(group), group);
        
 
-       exit(0);
+       return(0);
 }
 
 
index 37148225121795e15d26b92e644d42da64ffb9a9..2233a1d68d032d318d13cd6e43ae745e34526d2b 100644 (file)
@@ -136,7 +136,7 @@ extern int ln_main(int argc, char **argv)
                        exit FALSE;
                }
        }
-       exit TRUE;
+       return( TRUE);
 }
 
 /*
index 7c6153f64e2aa7846664e829945530e403647e45..4b4483cc166cd276fcb27b1041dc236d0b27bac7 100644 (file)
@@ -42,5 +42,5 @@ extern int logname_main(int argc, char **argv)
                exit(TRUE);
        }
        fprintf(stderr, "no login name\n");
-       exit(FALSE);
+       return(FALSE);
 }
index 96649868dc77e908bd48bd91ee3c5f86aa09afc6..b18c949b844d68c19903852b2e0c438d849eeb3d 100644 (file)
@@ -112,5 +112,5 @@ extern int mkdir_main(int argc, char **argv)
                argc--;
                argv++;
        }
-       exit TRUE;
+       return( TRUE);
 }
index 46b1343cd33c2f46c58825e9b3caad75b9a4bce8..f701a97d58f50b8124196507baf52be7d4145689 100644 (file)
@@ -65,7 +65,6 @@ extern int mkfifo_main(int argc, char **argv)
        if (mkfifo(*argv, mode) < 0) {
                perror("mkfifo");
                exit(255);
-       } else {
-               exit(TRUE);
        }
+       return(TRUE);
 }
index 8f411a341ab9167247a4f384f5d981e04adf982a..ac96817ee20b99119585b5a21573494d3054d723 100644 (file)
@@ -98,6 +98,6 @@ int mknod_main(int argc, char **argv)
 
        if (mknod(argv[0], mode, dev) != 0)
                fatalError("%s: %s\n", argv[0], strerror(errno));
-       exit (TRUE);
+       return (TRUE);
 }
 
index 146ef332baecafe3e7e59101406ff7f7c5aeb25a..87553b3de38a017c8798d1312a46c630c0b6dfa1 100644 (file)
@@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv)
                fatalError("pwd: %s\n", strerror(errno));
 
        printf("%s\n", buf);
-       exit(TRUE);
+       return(TRUE);
 }
index b1cda3aed061c0fa8e3d9a3b67da0cb7f6a498b1..2067d878c269f266dc9d05a8d06f6cc23de10b5c 100644 (file)
@@ -112,5 +112,5 @@ extern int rm_main(int argc, char **argv)
                        }
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
index 61d7f2aa53ba7cf7550042acbdeda98d08fa384a..0751808c047920d503f1a213f57953c16e1ccaa8 100644 (file)
@@ -44,5 +44,5 @@ extern int rmdir_main(int argc, char **argv)
                        exit(FALSE);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
index 13f07c02feab2990cb1b601109e756f9d9486e23..c7ab32d4bc96467f77049b9bddd9e51242d12efc 100644 (file)
@@ -39,6 +39,6 @@ extern int sleep_main(int argc, char **argv)
        if (sleep(atoi(*(++argv))) != 0) {
                perror("sleep");
                exit(FALSE);
-       } else
-               exit(TRUE);
+       }
+       return(TRUE);
 }
index 1edc7d1caa4f3dcc510abb628601388e7a799099..93062faa4050f86a16134531ea92c1f7484b9804 100644 (file)
@@ -301,7 +301,7 @@ int sort_main(int argc, char **argv)
                list_release(&list);
        }
 
-       exit(0);
+       return(0);
 }
 
-/* $Id: sort.c,v 1.16 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: sort.c,v 1.17 2000/06/19 17:25:40 andersen Exp $ */
index 33c79228d7108f5398aee9492cd9824f8dccd3ce..db35d72faec2aacb8e5f1b924e4a13c5714d3454 100644 (file)
@@ -33,5 +33,5 @@ extern int sync_main(int argc, char **argv)
 #endif
                                );
        }
-       exit(sync());
+       return(sync());
 }
index 2027d921dba68c07fc8e610fa01cb4388ac4704b..3189d204f47c8c0061337d586099c8feda6d2d25 100644 (file)
@@ -400,7 +400,7 @@ extern int tail_main(int argc, char **argv)
                        exit_status |= tail_file(argv[i], n_units);
        }
 
-       exit(exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
+       return(exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
 
index a78edc039348f3d1a938fab8d342c5280a56caa8..c9b5410d312347d59e200b6497bb5566844d941c 100644 (file)
@@ -130,7 +130,7 @@ int tee_main(int argc, char **argv)
        /* Don't bother to close files  Exit does that 
         * automagically, so we can save a few bytes */
        /* free(FileList); */
-       exit(0);
+       return(0);
 }
 
-/* $Id: tee.c,v 1.10 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: tee.c,v 1.11 2000/06/19 17:25:40 andersen Exp $ */
index 0a16e9328c2d8c86ecd0dd192d64f63b2b4c9831..36da4db0b76ad8c98d43163a856bb1fedb43f1b9 100644 (file)
@@ -235,7 +235,7 @@ test_main(int argc, char** argv)
        if (*t_wp != NULL && *++t_wp != NULL)
                syntax(*t_wp, "unknown operand");
 
-       exit( res);
+       return( res);
 }
 
 static void
index 1364bb7d57c1f5655a89ca1664faddcac9a89ce0..f52bb0284202ddea81bfa48a923c82f11b41493c 100644 (file)
@@ -81,5 +81,5 @@ extern int touch_main(int argc, char **argv)
                argv++;
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
index 3a318ebbab5f5c1a40ac04e748a1a9b2b9ca86fa..f3c7fb74f5ceefb3297a839c6b170ebfd1a6da3f 100644 (file)
@@ -46,5 +46,5 @@ extern int tty_main(int argc, char **argv)
                else
                        puts("not a tty");
        }
-       exit(isatty(0) ? TRUE : FALSE);
+       return(isatty(0) ? TRUE : FALSE);
 }
index 981ac69ed2dcfa824125a506641de0f9f316aed3..b7c88ece5f458b51375511e2299f4a105e06df8a 100644 (file)
@@ -156,7 +156,7 @@ int uname_main(int argc, char **argv)
        print_element(PRINT_MACHINE, name.machine);
        print_element(PRINT_PROCESSOR, processor);
 
-       exit(TRUE);
+       return(TRUE);
 }
 
 /* If the name element set in MASK is selected for printing in `toprint',
index 0cccbd5e7639774fc2a22a7b5419cc8932a05a64..64acf046ad0088fe7a73a495f113e74de69fc947 100644 (file)
@@ -184,7 +184,7 @@ int uniq_main(int argc, char **argv)
        subject_last(&s);
        subject_study(&s);
 
-       exit(0);
+       return(0);
 }
 
-/* $Id: uniq.c,v 1.10 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: uniq.c,v 1.11 2000/06/19 17:25:40 andersen Exp $ */
index 34008a638aab4fe683a209c1910a3c4a4697d268..da6cca9ab732dcb165be2616888bf538d8cbf5a9 100644 (file)
@@ -38,5 +38,5 @@ extern int usleep_main(int argc, char **argv)
        }
 
        usleep(atoi(*(++argv)));        /* return void */
-       exit(TRUE);
+       return(TRUE);
 }
index 4216e336a6445ef4dc0566ae31808c4c234774f8..752497cb093641fdaff9decf7dce3779cac5ebb4 100644 (file)
@@ -346,5 +346,5 @@ int uudecode_main (int argc,
     }
     while (optind < argc);
   }
-  exit(exit_status);
+  return(exit_status);
 }
index 91136b3e6d557b2376d7aa0fc786403bf87515ab..97801aa097ec8b400e029ab2478bd18a619038b0 100644 (file)
@@ -240,5 +240,5 @@ int uuencode_main (int argc,
     errorMsg("Write error\n");
     exit FALSE;
   }
-  exit TRUE;
+  return( TRUE);
 }
index 57bc7135a247591c258c20fdd951252a7afed398..bad03f79152fafb2be918ee223ccbf3eed4d67c5 100644 (file)
@@ -166,5 +166,5 @@ int wc_main(int argc, char **argv)
                print_counts(total_lines, total_words, total_chars,
                                         max_length, "total");
        }
-       exit(TRUE);
+       return(TRUE);
 }
index da584790d83e1e5c4ccc33263acf0084f5f50c3d..950f52fb2e54feefe7aab388a63b14b901c9c6c3 100644 (file)
@@ -45,5 +45,5 @@ extern int whoami_main(int argc, char **argv)
        }
        fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0],
                        (unsigned) uid);
-       exit(FALSE);
+       return(FALSE);
 }
diff --git a/cp_mv.c b/cp_mv.c
index c8d6562f13454742a1cfa0380ed3db21329bacd2..b15235a2573cda3375f2dd1f5833bd457411884a 100644 (file)
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -90,7 +90,7 @@ static
 void name_too_long__exit (void)
 {
        fprintf(stderr, name_too_long, dz);
-       exit FALSE;
+       exit(FALSE);
 }
 
 static void
@@ -333,10 +333,9 @@ extern int cp_mv_main(int argc, char **argv)
                if (flags_memo)
                        *(baseDestName + baseDestLen) = '\0';
        }
-// exit_true:
-       exit TRUE;
+       return( TRUE);
  exit_false:
-       exit FALSE;
+       return( FALSE);
 }
 
 /*
diff --git a/cut.c b/cut.c
index 89a934e76b60fc7d3da3a92d3f32744d7b449751..7b183e8fdedacf209b1b17821cc5fc0415ffd7d1 100644 (file)
--- a/cut.c
+++ b/cut.c
@@ -307,7 +307,7 @@ int cut_main(int argc, char **argv)
                cut();
        }
 
-       exit(exit_status);
+       return(exit_status);
 }
 
 /* cut - extract columns from a file or stdin.         Author: Michael J. Holme
diff --git a/date.c b/date.c
index 8e584cecc128b89746807eabdc99e63362c6c4f8..9e8e3f3eb44ba8146c247215ea1906af12600830 100644 (file)
--- a/date.c
+++ b/date.c
@@ -273,6 +273,5 @@ int date_main(int argc, char **argv)
        strftime(t_buff, 200, date_fmt, &tm_time);
        printf("%s\n", t_buff);
 
-       exit(TRUE);
-
+       return(TRUE);
 }
index a1b8e4eeab85aec712ed0fef134ccc68c0dd81ef..b65f7b098fb8cdfdc26a95b9dbe81cb3f17ec900 100644 (file)
@@ -34,7 +34,7 @@ int deallocvt_main(int argc, char *argv[])
                /* deallocate all unused consoles */
                if (ioctl(fd, VT_DISALLOCATE, 0)) {
                        perror("VT_DISALLOCATE");
-                       exit(1);
+                       exit( FALSE);
                }
        } else
                for (i = 1; i < argc; i++) {
@@ -48,8 +48,8 @@ int deallocvt_main(int argc, char *argv[])
                                perror("VT_DISALLOCATE");
                                fprintf(stderr, "%s: could not deallocate console %d\n",
                                                progname, num);
-                               exit(1);
+                               exit( FALSE);
                        }
                }
-       exit(0);
+       return( TRUE);
 }
diff --git a/df.c b/df.c
index 07e61d87d64d354f91848918b4d53ff5d9402182..ba3227f304ee771b828be0257717312ef5fe0afe 100644 (file)
--- a/df.c
+++ b/df.c
@@ -108,7 +108,7 @@ extern int df_main(int argc, char **argv)
                endmntent(mountTable);
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
index ce3cd6f03d24e7cd4aeb871ec7fddcf03d5b03cf..847842eab02340322abd9ec57c78c50ab35187a4 100644 (file)
--- a/dirname.c
+++ b/dirname.c
@@ -45,5 +45,5 @@ extern int dirname_main(int argc, char **argv)
        if (s && *s)
                *s = '\0';
        printf("%s\n", (s)? *argv : ".");
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/dmesg.c b/dmesg.c
index c4f4fb408f6810c23f82ae0b236ac46095d9fca9..20846f7c657098ef3bb5335d50f8b7966682fb7c 100644 (file)
--- a/dmesg.c
+++ b/dmesg.c
@@ -128,6 +128,5 @@ int dmesg_main(int argc, char **argv)
        exit(FALSE);
   klogctl_error:
        perror("klogctl");
-       exit(FALSE);
-
+       return(FALSE);
 }
diff --git a/du.c b/du.c
index 9c699978e7c33c8416042129d12e4d789a06f181..b8e296ddd20f3bea2a1f761c2ebc8a38baf1ea76 100644 (file)
--- a/du.c
+++ b/du.c
@@ -181,10 +181,10 @@ int du_main(int argc, char **argv)
                }
        }
 
-       exit(0);
+       return(0);
 }
 
-/* $Id: du.c,v 1.19 2000/05/10 05:05:45 erik Exp $ */
+/* $Id: du.c,v 1.20 2000/06/19 17:25:39 andersen Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
diff --git a/dutmp.c b/dutmp.c
index f264fd75bfbd8c01808b5d215a655704acbca3f5..c6bc0c794faea98d0bcd425ab64584f8a0c6c6cd 100644 (file)
--- a/dutmp.c
+++ b/dutmp.c
@@ -56,5 +56,5 @@ extern int dutmp_main(int argc, char **argv)
                                (long)ut.ut_addr);
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/echo.c b/echo.c
index b31f2229bb784e9b3ff39ade751f51ff137c44b7..4659e4bc627f9f07dae50515440fdc1a8489e4dd 100644 (file)
--- a/echo.c
+++ b/echo.c
@@ -96,7 +96,7 @@ echo_main(int argc, char** argv)
        if (! nflag)
                putchar('\n');
        fflush(stdout);
-       exit( 0);
+       return( 0);
 }
 
 /*-
index 955858f7f99a97c28d9222bac8105c4a8882d977..d4b721e4944fc57226053f886730c60cdc332101 100644 (file)
@@ -352,7 +352,7 @@ extern int sed_main(int argc, char **argv)
                        fclose(fp);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 
diff --git a/fbset.c b/fbset.c
index de4c82425fcf6f3396183d92deb8a8276444d9cc..0a84dce236b42e0b51d30181b24798c4e47b9e33 100644 (file)
--- a/fbset.c
+++ b/fbset.c
@@ -329,5 +329,5 @@ extern int fbset_main(int argc, char **argv)
        /* Don't close the file, as exiting will take care of that */
        /* close(fh); */
 
-       exit (TRUE);
+       return (TRUE);
 }
index 4ec0a8886b9a6dfe35ff9a31c64e82afb488a677..81f0472c6400308a4b0d36308c291f7c8823ad31 100644 (file)
--- a/fdflush.c
+++ b/fdflush.c
@@ -56,5 +56,5 @@ extern int fdflush_main(int argc, char **argv)
                perror(*argv);
                exit(FALSE);
        }
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/find.c b/find.c
index 53b85e6b39d018d1055db0d5343fb5b3e9b95c3d..329d1519357f0f89458fb4678dfd0fd92018558d 100644 (file)
--- a/find.c
+++ b/find.c
@@ -116,5 +116,5 @@ int find_main(int argc, char **argv)
                exit(FALSE);
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
index 53b85e6b39d018d1055db0d5343fb5b3e9b95c3d..329d1519357f0f89458fb4678dfd0fd92018558d 100644 (file)
@@ -116,5 +116,5 @@ int find_main(int argc, char **argv)
                exit(FALSE);
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
index b91fe7c2c35b9b533493cafd3a4722b991810a56..0e495ff87e19648c674941a47e80cd144839a568 100644 (file)
@@ -163,7 +163,7 @@ extern int grep_main(int argc, char **argv)
                        fclose(fp);
                }
        }
-       exit(match);
+       return(match);
 }
 
 
index 7a11bf7876839390cb9a8f2b266427e4b9f57c76..8d4422a78d1d15ef18276b33b3691d8b466fcc75 100644 (file)
@@ -88,7 +88,7 @@ extern int which_main(int argc, char **argv)
                        exit (FALSE);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
diff --git a/free.c b/free.c
index e6f130ea9891cdebb5227fee4da9fd2eab02926c..a81189be9066b9dead885304b7dc33f616a4c546 100644 (file)
--- a/free.c
+++ b/free.c
@@ -59,5 +59,5 @@ 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);
-       exit(TRUE);
+       return(TRUE);
 }
index cabe5660bf71bced636359d87a7326d396e90845..fdac5ea46094090b6ef77aec1721676e9a1e53d9 100644 (file)
@@ -58,7 +58,7 @@ freeramdisk_main(int argc, char **argv)
        /* Don't bother closing.  Exit does
         * that, so we can save a few bytes */
        /* close(f); */
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
diff --git a/grep.c b/grep.c
index b91fe7c2c35b9b533493cafd3a4722b991810a56..0e495ff87e19648c674941a47e80cd144839a568 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -163,7 +163,7 @@ extern int grep_main(int argc, char **argv)
                        fclose(fp);
                }
        }
-       exit(match);
+       return(match);
 }
 
 
index 78ee1d3c1526834ce912b9d53590d1342fbd138b..f2bb59dd7262ed568d47c1f3867a40120cf4819a 100644 (file)
--- a/gunzip.c
+++ b/gunzip.c
@@ -746,7 +746,7 @@ int gunzip_main(int argc, char **argv)
                        exit(FALSE);
                }
        }
-       exit(exit_code);
+       return(exit_code);
 }
 
 
diff --git a/gzip.c b/gzip.c
index a971229d33bb5184ff387276fceb69065ee1d9ef..9248cfecd651bb5b19a0d474b4d2d7d90abb0fc5 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -282,8 +282,6 @@ extern int save_orig_name;          /* set if original name must be saved */
 #define WARN(msg) {if (!quiet) fprintf msg ; \
                   if (exit_code == OK) exit_code = WARNING;}
 
-#define do_exit(c) exit(c)
-
 
        /* in zip.c: */
 extern int zip (int in, int out);
@@ -1883,13 +1881,13 @@ int gzip_main(int argc, char **argv)
                inFileNum = open(ifname, O_RDONLY);
                if (inFileNum < 0) {
                        perror(ifname);
-                       do_exit(WARNING);
+                       exit(WARNING);
                }
                /* Get the time stamp on the input file. */
                result = stat(ifname, &statBuf);
                if (result < 0) {
                        perror(ifname);
-                       do_exit(WARNING);
+                       exit(WARNING);
                }
                time_stamp = statBuf.st_ctime;
                ifile_size = statBuf.st_size;
@@ -1923,7 +1921,7 @@ int gzip_main(int argc, char **argv)
 #endif
                if (outFileNum < 0) {
                        perror(ofname);
-                       do_exit(WARNING);
+                       exit(WARNING);
                }
                SET_BINARY_MODE(outFileNum);
                /* Set permissions on the file */
@@ -1948,7 +1946,7 @@ int gzip_main(int argc, char **argv)
                }
        }
 
-       do_exit(exit_code);
+       return(exit_code);
 }
 
 /* trees.c -- output deflated data using Huffman coding
diff --git a/halt.c b/halt.c
index bcd69b9525c13de954a3bb2657e53416cd6cd554..2ca36d038eb1d653fe0e60a8548adece67e7ea1a 100644 (file)
--- a/halt.c
+++ b/halt.c
@@ -28,8 +28,8 @@ extern int halt_main(int argc, char **argv)
 {
 #ifdef BB_FEATURE_LINUXRC
        /* don't assume init's pid == 1 */
-       exit(kill(*(findPidByName("init")), SIGUSR1));
+       return(kill(*(findPidByName("init")), SIGUSR1));
 #else
-       exit(kill(1, SIGUSR1));
+       return(kill(1, SIGUSR1));
 #endif
 }
diff --git a/head.c b/head.c
index f4ebe05c9a66b27025fd84530e7793d1c7519d81..f42f4837d323a6bddad94ea6cc6cd41a7a7675ea 100644 (file)
--- a/head.c
+++ b/head.c
@@ -109,7 +109,7 @@ int head_main(int argc, char **argv)
                        }
                }
        }
-       exit(0);
+       return(0);
 }
 
-/* $Id: head.c,v 1.10 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: head.c,v 1.11 2000/06/19 17:25:39 andersen Exp $ */
index 9e503e5984697cfbb497ab9190f2d26ea3489db7..f1010a65d524fa11301801018d22a7138478b3e6 100644 (file)
--- a/hostid.c
+++ b/hostid.c
@@ -26,5 +26,5 @@
 extern int hostid_main(int argc, char **argv)
 {
        printf("%lx\n", gethostid());
-       exit(TRUE);
+       return(TRUE);
 }
index 0df9fed75924427998d069ac71fd801b262ba0ea..e909138e49fb2a80a0092559d6576ac0996a881b 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: hostname.c,v 1.9 2000/05/19 05:35:18 erik Exp $
+ * $Id: hostname.c,v 1.10 2000/06/19 17:25:39 andersen Exp $
  * Mini hostname implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -143,5 +143,5 @@ int hostname_main(int argc, char **argv)
                        printf("%s\n", buf);
                }
        }
-       exit(0);
+       return(0);
 }
diff --git a/id.c b/id.c
index 23bbc16aed7f6884fc309d43edb9ad9cbc7b3ab6..69dfe2658c855a5ef7c0be767ca5c3d64b6b90bd 100644 (file)
--- a/id.c
+++ b/id.c
@@ -89,7 +89,7 @@ extern int id_main(int argc, char **argv)
                           my_getpwnam(user), user, my_getgrnam(group), group);
        
 
-       exit(0);
+       return(0);
 }
 
 
index bcd69b9525c13de954a3bb2657e53416cd6cd554..2ca36d038eb1d653fe0e60a8548adece67e7ea1a 100644 (file)
@@ -28,8 +28,8 @@ extern int halt_main(int argc, char **argv)
 {
 #ifdef BB_FEATURE_LINUXRC
        /* don't assume init's pid == 1 */
-       exit(kill(*(findPidByName("init")), SIGUSR1));
+       return(kill(*(findPidByName("init")), SIGUSR1));
 #else
-       exit(kill(1, SIGUSR1));
+       return(kill(1, SIGUSR1));
 #endif
 }
index bc8e67716f412e25f918055b78b193e8563af50f..126a0fb9496e81fc08c8079127a7bc7a2714f0fb 100644 (file)
@@ -28,8 +28,8 @@ extern int poweroff_main(int argc, char **argv)
 {
 #ifdef BB_FEATURE_LINUXRC
        /* don't assume init's pid == 1 */
-       exit(kill(*(findPidByName("init")), SIGUSR2));
+       return(kill(*(findPidByName("init")), SIGUSR2));
 #else
-       exit(kill(1, SIGUSR2));
+       return(kill(1, SIGUSR2));
 #endif
 }
index 6e1f3d53b462d1eadb14064cf8d64c5709c95bda..bde8dbd7750d7dc1511f80c9f1ed141e94a81fce 100644 (file)
@@ -28,9 +28,9 @@ extern int reboot_main(int argc, char **argv)
 {
 #ifdef BB_FEATURE_LINUXRC
        /* don't assume init's pid == 1 */
-       exit(kill(*(findPidByName("init")), SIGINT));
+       return(kill(*(findPidByName("init")), SIGINT));
 #else
-       exit(kill(1, SIGINT));
+       return(kill(1, SIGINT));
 #endif
 }
 
index 9997f4dc46b0585437c7515c7d9c9966f34417ad..fce32c415406130b4a9247e0346e63cdd186f83e 100644 (file)
@@ -33,6 +33,7 @@
 #include <sys/stat.h>
 #include <sys/param.h>
 #include <mntent.h>
+#include <asm/string.h>
 
 
 /* Some useful definitions */
diff --git a/lash.c b/lash.c
index 8ea5e305befcbca4b28f9bc2f0ab9144b40e28cc..56d94258cdf6331ed3312958488b1473f7ec497f 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -188,8 +188,7 @@ static int shell_exit(struct job *cmd, struct jobSet *junk)
        if (!cmd->progs[0].argv[1] == 1)
                exit TRUE;
 
-       else
-               exit(atoi(cmd->progs[0].argv[1]));
+       return(atoi(cmd->progs[0].argv[1]));
 }
 
 /* built-in 'fg' and 'bg' handler */
diff --git a/ln.c b/ln.c
index 37148225121795e15d26b92e644d42da64ffb9a9..2233a1d68d032d318d13cd6e43ae745e34526d2b 100644 (file)
--- a/ln.c
+++ b/ln.c
@@ -136,7 +136,7 @@ extern int ln_main(int argc, char **argv)
                        exit FALSE;
                }
        }
-       exit TRUE;
+       return( TRUE);
 }
 
 /*
index cca5406ee3a7fe4bac9934306599144bdb7a7016..cf393d92ddf495e6fc0cba52700dce844cf8de4b 100644 (file)
--- a/loadacm.c
+++ b/loadacm.c
@@ -140,10 +140,9 @@ int screen_map_load(int fd, FILE * fp)
                        perror("PIO_SCRNMAP ioctl"), exit(1);
                else
                        return 0;
-       } else {
-               fprintf(stderr, "Error parsing symbolic map\n");
-               exit(1);
        }
+       fprintf(stderr, "Error parsing symbolic map\n");
+       return(1);
 }
 
 
index 99efc510179a1dfa9d8641b2370955e1cb350899..905741467cc33e7371ceb8dffdcc7736b8eec7e3 100644 (file)
@@ -94,5 +94,5 @@ int loadkmap_main(int argc, char **argv)
        /* Don't bother to close files.  Exit does that 
         * automagically, so we can save a few bytes */
        /* close(fd); */
-       exit(TRUE);
+       return(TRUE);
 }
index 118a5ded053fc742c2c4f92c5af447b123652d0a..d32ccaaf34e936213dd3a9dcb8469dc1538d43b8 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -118,7 +118,7 @@ extern int logger_main(int argc, char **argv)
        int option = 0;
        int fromStdinFlag = FALSE;
        int stopLookingAtMeLikeThat = FALSE;
-       char *message, buf[1024], name[128];
+       char *message=NULL, buf[1024], name[128];
 
        /* Fill out the name string early (may be overwritten later */
        my_getpwuid(name, geteuid());
@@ -175,5 +175,5 @@ extern int logger_main(int argc, char **argv)
        syslog(pri, message);
        closelog();
 
-       exit(TRUE);
+       return(TRUE);
 }
index 7c6153f64e2aa7846664e829945530e403647e45..4b4483cc166cd276fcb27b1041dc236d0b27bac7 100644 (file)
--- a/logname.c
+++ b/logname.c
@@ -42,5 +42,5 @@ extern int logname_main(int argc, char **argv)
                exit(TRUE);
        }
        fprintf(stderr, "no login name\n");
-       exit(FALSE);
+       return(FALSE);
 }
diff --git a/lsmod.c b/lsmod.c
index 9b72275cd264eb42864ed996aed61fbbee07cc02..d3b1bb79eb08707895340d15d14c8898c98ce62e 100644 (file)
--- a/lsmod.c
+++ b/lsmod.c
@@ -36,5 +36,5 @@ extern int lsmod_main(int argc, char **argv)
        char *cmd[] = { "cat", "/proc/modules", "\0" };
 #endif
 
-       exit(cat_main(3, cmd));
+       return(cat_main(3, cmd));
 }
diff --git a/math.c b/math.c
index 621b5c9b0c946f1d22844452c3967176e0f9ff25..eb8f331fdb96705bc520eaaad6e9aa69318a2f49 100644 (file)
--- a/math.c
+++ b/math.c
@@ -186,5 +186,5 @@ int math_main(int argc, char **argv)
                }
        }
        stack_machine(0);
-       exit( TRUE);
+       return( TRUE);
 }
index f264fd75bfbd8c01808b5d215a655704acbca3f5..c6bc0c794faea98d0bcd425ab64584f8a0c6c6cd 100644 (file)
@@ -56,5 +56,5 @@ extern int dutmp_main(int argc, char **argv)
                                (long)ut.ut_addr);
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
index b30b9a08fbfb1e2e92e12f26474e79eb271a36ff..87792cb1820feb6345f90bf2e60a9a19a072d947 100644 (file)
@@ -39,5 +39,5 @@ extern int mktemp_main(int argc, char **argv)
        if(mkstemp(argv[argc-1]) < 0)
                        exit(FALSE);
        (void) puts(argv[argc-1]);
-       exit(TRUE);
+       return(TRUE);
 }
index 44f23884c5d61e5ad1dc0bda981c2b22f06b173c..304d664853953d21ac32a44c82a2ddbead68728f 100644 (file)
@@ -101,5 +101,5 @@ extern int mt_main(int argc, char **argv)
                exit (FALSE);
        }
 
-       exit (TRUE);
+       return (TRUE);
 }
diff --git a/mkdir.c b/mkdir.c
index 96649868dc77e908bd48bd91ee3c5f86aa09afc6..b18c949b844d68c19903852b2e0c438d849eeb3d 100644 (file)
--- a/mkdir.c
+++ b/mkdir.c
@@ -112,5 +112,5 @@ extern int mkdir_main(int argc, char **argv)
                argc--;
                argv++;
        }
-       exit TRUE;
+       return( TRUE);
 }
index 46b1343cd33c2f46c58825e9b3caad75b9a4bce8..f701a97d58f50b8124196507baf52be7d4145689 100644 (file)
--- a/mkfifo.c
+++ b/mkfifo.c
@@ -65,7 +65,6 @@ extern int mkfifo_main(int argc, char **argv)
        if (mkfifo(*argv, mode) < 0) {
                perror("mkfifo");
                exit(255);
-       } else {
-               exit(TRUE);
        }
+       return(TRUE);
 }
diff --git a/mknod.c b/mknod.c
index 8f411a341ab9167247a4f384f5d981e04adf982a..ac96817ee20b99119585b5a21573494d3054d723 100644 (file)
--- a/mknod.c
+++ b/mknod.c
@@ -98,6 +98,6 @@ int mknod_main(int argc, char **argv)
 
        if (mknod(argv[0], mode, dev) != 0)
                fatalError("%s: %s\n", argv[0], strerror(errno));
-       exit (TRUE);
+       return (TRUE);
 }
 
index 7d76916f03be073d2bc8deb9d379963fb84c7ff3..fc37368f43d7ae872c5f955b41668353a7339519 100644 (file)
--- a/mkswap.c
+++ b/mkswap.c
@@ -469,5 +469,5 @@ the -f option to force it.\n", program_name, device_name);
         */
        if (fsync(DEV))
                die("fsync failed");
-       exit(TRUE);
+       return(TRUE);
 }
index b30b9a08fbfb1e2e92e12f26474e79eb271a36ff..87792cb1820feb6345f90bf2e60a9a19a072d947 100644 (file)
--- a/mktemp.c
+++ b/mktemp.c
@@ -39,5 +39,5 @@ extern int mktemp_main(int argc, char **argv)
        if(mkstemp(argv[argc-1]) < 0)
                        exit(FALSE);
        (void) puts(argv[argc-1]);
-       exit(TRUE);
+       return(TRUE);
 }
index 9b72275cd264eb42864ed996aed61fbbee07cc02..d3b1bb79eb08707895340d15d14c8898c98ce62e 100644 (file)
@@ -36,5 +36,5 @@ extern int lsmod_main(int argc, char **argv)
        char *cmd[] = { "cat", "/proc/modules", "\0" };
 #endif
 
-       exit(cat_main(3, cmd));
+       return(cat_main(3, cmd));
 }
index 5ef4a60f8a98e0556ee3ebbf1783304f504ed9f4..a73d789f20c3e57efe5392c3fd1d17408ecd913a 100644 (file)
@@ -75,5 +75,5 @@ extern int rmmod_main(int argc, char **argv)
                }
                argv++;
        }
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/more.c b/more.c
index 549a417307e6d307f8cbb93f6522d19de25e95e8..13101657810d4e6da140a29232c0d73c98832675 100644 (file)
--- a/more.c
+++ b/more.c
@@ -221,5 +221,5 @@ extern int more_main(int argc, char **argv)
 #ifdef BB_FEATURE_USE_TERMIOS
        gotsig(0);
 #endif
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/mt.c b/mt.c
index 44f23884c5d61e5ad1dc0bda981c2b22f06b173c..304d664853953d21ac32a44c82a2ddbead68728f 100644 (file)
--- a/mt.c
+++ b/mt.c
@@ -101,5 +101,5 @@ extern int mt_main(int argc, char **argv)
                exit (FALSE);
        }
 
-       exit (TRUE);
+       return (TRUE);
 }
index 0df9fed75924427998d069ac71fd801b262ba0ea..e909138e49fb2a80a0092559d6576ac0996a881b 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: hostname.c,v 1.9 2000/05/19 05:35:18 erik Exp $
+ * $Id: hostname.c,v 1.10 2000/06/19 17:25:39 andersen Exp $
  * Mini hostname implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -143,5 +143,5 @@ int hostname_main(int argc, char **argv)
                        printf("%s\n", buf);
                }
        }
-       exit(0);
+       return(0);
 }
index 82bcf56a16e8bdf727234942dd1b954cbb76b894..54f37c8481d690b12f456b429fd1bd789a45601d 100644 (file)
@@ -174,7 +174,7 @@ int nslookup_main(int argc, char **argv)
                host = gethostbyname(argv[1]);
        }
        hostent_fprint(host, stdout);
-       exit( TRUE);
+       return( TRUE);
 }
 
-/* $Id: nslookup.c,v 1.9 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: nslookup.c,v 1.10 2000/06/19 17:25:40 andersen Exp $ */
index 82bcf56a16e8bdf727234942dd1b954cbb76b894..54f37c8481d690b12f456b429fd1bd789a45601d 100644 (file)
@@ -174,7 +174,7 @@ int nslookup_main(int argc, char **argv)
                host = gethostbyname(argv[1]);
        }
        hostent_fprint(host, stdout);
-       exit( TRUE);
+       return( TRUE);
 }
 
-/* $Id: nslookup.c,v 1.9 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: nslookup.c,v 1.10 2000/06/19 17:25:40 andersen Exp $ */
index bc8e67716f412e25f918055b78b193e8563af50f..126a0fb9496e81fc08c8079127a7bc7a2714f0fb 100644 (file)
@@ -28,8 +28,8 @@ extern int poweroff_main(int argc, char **argv)
 {
 #ifdef BB_FEATURE_LINUXRC
        /* don't assume init's pid == 1 */
-       exit(kill(*(findPidByName("init")), SIGUSR2));
+       return(kill(*(findPidByName("init")), SIGUSR2));
 #else
-       exit(kill(1, SIGUSR2));
+       return(kill(1, SIGUSR2));
 #endif
 }
index e6f130ea9891cdebb5227fee4da9fd2eab02926c..a81189be9066b9dead885304b7dc33f616a4c546 100644 (file)
@@ -59,5 +59,5 @@ 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);
-       exit(TRUE);
+       return(TRUE);
 }
index 41b8465bd41081fd126c1a40a6cbd8e114a32a87..13b6ce541d4e9dd1ae2715916314dbc7e906cd04 100644 (file)
@@ -192,7 +192,7 @@ extern int ps_main(int argc, char **argv)
                fprintf(stdout, "\n");
        }
        closedir(dir);
-       exit(TRUE);
+       return(TRUE);
 }
 
 
index af54158c967250c9e42dcaef5adedf226f83db69..67ca34d7556d7a72b39ec85a702873f79dd3a741 100644 (file)
@@ -69,5 +69,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]));
 
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/ps.c b/ps.c
index 41b8465bd41081fd126c1a40a6cbd8e114a32a87..13b6ce541d4e9dd1ae2715916314dbc7e906cd04 100644 (file)
--- a/ps.c
+++ b/ps.c
@@ -192,7 +192,7 @@ extern int ps_main(int argc, char **argv)
                fprintf(stdout, "\n");
        }
        closedir(dir);
-       exit(TRUE);
+       return(TRUE);
 }
 
 
diff --git a/pwd.c b/pwd.c
index 146ef332baecafe3e7e59101406ff7f7c5aeb25a..87553b3de38a017c8798d1312a46c630c0b6dfa1 100644 (file)
--- a/pwd.c
+++ b/pwd.c
@@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv)
                fatalError("pwd: %s\n", strerror(errno));
 
        printf("%s\n", buf);
-       exit(TRUE);
+       return(TRUE);
 }
index 6e1f3d53b462d1eadb14064cf8d64c5709c95bda..bde8dbd7750d7dc1511f80c9f1ed141e94a81fce 100644 (file)
--- a/reboot.c
+++ b/reboot.c
@@ -28,9 +28,9 @@ extern int reboot_main(int argc, char **argv)
 {
 #ifdef BB_FEATURE_LINUXRC
        /* don't assume init's pid == 1 */
-       exit(kill(*(findPidByName("init")), SIGINT));
+       return(kill(*(findPidByName("init")), SIGINT));
 #else
-       exit(kill(1, SIGINT));
+       return(kill(1, SIGINT));
 #endif
 }
 
diff --git a/rm.c b/rm.c
index b1cda3aed061c0fa8e3d9a3b67da0cb7f6a498b1..2067d878c269f266dc9d05a8d06f6cc23de10b5c 100644 (file)
--- a/rm.c
+++ b/rm.c
@@ -112,5 +112,5 @@ extern int rm_main(int argc, char **argv)
                        }
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/rmdir.c b/rmdir.c
index 61d7f2aa53ba7cf7550042acbdeda98d08fa384a..0751808c047920d503f1a213f57953c16e1ccaa8 100644 (file)
--- a/rmdir.c
+++ b/rmdir.c
@@ -44,5 +44,5 @@ extern int rmdir_main(int argc, char **argv)
                        exit(FALSE);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/rmmod.c b/rmmod.c
index 5ef4a60f8a98e0556ee3ebbf1783304f504ed9f4..a73d789f20c3e57efe5392c3fd1d17408ecd913a 100644 (file)
--- a/rmmod.c
+++ b/rmmod.c
@@ -75,5 +75,5 @@ extern int rmmod_main(int argc, char **argv)
                }
                argv++;
        }
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/sed.c b/sed.c
index 955858f7f99a97c28d9222bac8105c4a8882d977..d4b721e4944fc57226053f886730c60cdc332101 100644 (file)
--- a/sed.c
+++ b/sed.c
@@ -352,7 +352,7 @@ extern int sed_main(int argc, char **argv)
                        fclose(fp);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 
index e933e14bc24440a499e902a2fb21102a2b1c0a9f..9062caf75a0d4afb6b77b3efdf11bd77bcf05393 100644 (file)
@@ -72,5 +72,5 @@ setkeycodes_main(int argc, char** argv)
        argc -= 2;
        argv += 2;
     }
-    exit( TRUE);
+    return( TRUE);
 }
diff --git a/sh.c b/sh.c
index 8ea5e305befcbca4b28f9bc2f0ab9144b40e28cc..56d94258cdf6331ed3312958488b1473f7ec497f 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -188,8 +188,7 @@ static int shell_exit(struct job *cmd, struct jobSet *junk)
        if (!cmd->progs[0].argv[1] == 1)
                exit TRUE;
 
-       else
-               exit(atoi(cmd->progs[0].argv[1]));
+       return(atoi(cmd->progs[0].argv[1]));
 }
 
 /* built-in 'fg' and 'bg' handler */
index 8ea5e305befcbca4b28f9bc2f0ab9144b40e28cc..56d94258cdf6331ed3312958488b1473f7ec497f 100644 (file)
@@ -188,8 +188,7 @@ static int shell_exit(struct job *cmd, struct jobSet *junk)
        if (!cmd->progs[0].argv[1] == 1)
                exit TRUE;
 
-       else
-               exit(atoi(cmd->progs[0].argv[1]));
+       return(atoi(cmd->progs[0].argv[1]));
 }
 
 /* built-in 'fg' and 'bg' handler */
diff --git a/sleep.c b/sleep.c
index 13f07c02feab2990cb1b601109e756f9d9486e23..c7ab32d4bc96467f77049b9bddd9e51242d12efc 100644 (file)
--- a/sleep.c
+++ b/sleep.c
@@ -39,6 +39,6 @@ extern int sleep_main(int argc, char **argv)
        if (sleep(atoi(*(++argv))) != 0) {
                perror("sleep");
                exit(FALSE);
-       } else
-               exit(TRUE);
+       }
+       return(TRUE);
 }
diff --git a/sort.c b/sort.c
index 1edc7d1caa4f3dcc510abb628601388e7a799099..93062faa4050f86a16134531ea92c1f7484b9804 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -301,7 +301,7 @@ int sort_main(int argc, char **argv)
                list_release(&list);
        }
 
-       exit(0);
+       return(0);
 }
 
-/* $Id: sort.c,v 1.16 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: sort.c,v 1.17 2000/06/19 17:25:40 andersen Exp $ */
diff --git a/sync.c b/sync.c
index 33c79228d7108f5398aee9492cd9824f8dccd3ce..db35d72faec2aacb8e5f1b924e4a13c5714d3454 100644 (file)
--- a/sync.c
+++ b/sync.c
@@ -33,5 +33,5 @@ extern int sync_main(int argc, char **argv)
 #endif
                                );
        }
-       exit(sync());
+       return(sync());
 }
index 118a5ded053fc742c2c4f92c5af447b123652d0a..d32ccaaf34e936213dd3a9dcb8469dc1538d43b8 100644 (file)
@@ -118,7 +118,7 @@ extern int logger_main(int argc, char **argv)
        int option = 0;
        int fromStdinFlag = FALSE;
        int stopLookingAtMeLikeThat = FALSE;
-       char *message, buf[1024], name[128];
+       char *message=NULL, buf[1024], name[128];
 
        /* Fill out the name string early (may be overwritten later */
        my_getpwuid(name, geteuid());
@@ -175,5 +175,5 @@ extern int logger_main(int argc, char **argv)
        syslog(pri, message);
        closelog();
 
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/tail.c b/tail.c
index 2027d921dba68c07fc8e610fa01cb4388ac4704b..3189d204f47c8c0061337d586099c8feda6d2d25 100644 (file)
--- a/tail.c
+++ b/tail.c
@@ -400,7 +400,7 @@ extern int tail_main(int argc, char **argv)
                        exit_status |= tail_file(argv[i], n_units);
        }
 
-       exit(exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
+       return(exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
 
 
diff --git a/tee.c b/tee.c
index a78edc039348f3d1a938fab8d342c5280a56caa8..c9b5410d312347d59e200b6497bb5566844d941c 100644 (file)
--- a/tee.c
+++ b/tee.c
@@ -130,7 +130,7 @@ int tee_main(int argc, char **argv)
        /* Don't bother to close files  Exit does that 
         * automagically, so we can save a few bytes */
        /* free(FileList); */
-       exit(0);
+       return(0);
 }
 
-/* $Id: tee.c,v 1.10 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: tee.c,v 1.11 2000/06/19 17:25:40 andersen Exp $ */
diff --git a/test.c b/test.c
index 0a16e9328c2d8c86ecd0dd192d64f63b2b4c9831..36da4db0b76ad8c98d43163a856bb1fedb43f1b9 100644 (file)
--- a/test.c
+++ b/test.c
@@ -235,7 +235,7 @@ test_main(int argc, char** argv)
        if (*t_wp != NULL && *++t_wp != NULL)
                syntax(*t_wp, "unknown operand");
 
-       exit( res);
+       return( res);
 }
 
 static void
diff --git a/touch.c b/touch.c
index 1364bb7d57c1f5655a89ca1664faddcac9a89ce0..f52bb0284202ddea81bfa48a923c82f11b41493c 100644 (file)
--- a/touch.c
+++ b/touch.c
@@ -81,5 +81,5 @@ extern int touch_main(int argc, char **argv)
                argv++;
        }
 
-       exit(TRUE);
+       return(TRUE);
 }
index 5ae221b3a2810c66d76a9853e00488a44f6852c4..c56f5e7afe95cfcf4e7d04b034e8471e0de65205 100644 (file)
 
 extern int true_main(int argc, char **argv)
 {
-       exit(TRUE);
+       return(TRUE);
 }
 
 extern int false_main(int argc, char **argv)
 {
-       exit(FALSE);
+       return(FALSE);
 }
diff --git a/tty.c b/tty.c
index 3a318ebbab5f5c1a40ac04e748a1a9b2b9ca86fa..f3c7fb74f5ceefb3297a839c6b170ebfd1a6da3f 100644 (file)
--- a/tty.c
+++ b/tty.c
@@ -46,5 +46,5 @@ extern int tty_main(int argc, char **argv)
                else
                        puts("not a tty");
        }
-       exit(isatty(0) ? TRUE : FALSE);
+       return(isatty(0) ? TRUE : FALSE);
 }
diff --git a/uname.c b/uname.c
index 981ac69ed2dcfa824125a506641de0f9f316aed3..b7c88ece5f458b51375511e2299f4a105e06df8a 100644 (file)
--- a/uname.c
+++ b/uname.c
@@ -156,7 +156,7 @@ int uname_main(int argc, char **argv)
        print_element(PRINT_MACHINE, name.machine);
        print_element(PRINT_PROCESSOR, processor);
 
-       exit(TRUE);
+       return(TRUE);
 }
 
 /* If the name element set in MASK is selected for printing in `toprint',
diff --git a/uniq.c b/uniq.c
index 0cccbd5e7639774fc2a22a7b5419cc8932a05a64..64acf046ad0088fe7a73a495f113e74de69fc947 100644 (file)
--- a/uniq.c
+++ b/uniq.c
@@ -184,7 +184,7 @@ int uniq_main(int argc, char **argv)
        subject_last(&s);
        subject_study(&s);
 
-       exit(0);
+       return(0);
 }
 
-/* $Id: uniq.c,v 1.10 2000/05/12 19:41:47 erik Exp $ */
+/* $Id: uniq.c,v 1.11 2000/06/19 17:25:40 andersen Exp $ */
index af54158c967250c9e42dcaef5adedf226f83db69..67ca34d7556d7a72b39ec85a702873f79dd3a741 100644 (file)
--- a/uptime.c
+++ b/uptime.c
@@ -69,5 +69,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]));
 
-       exit(TRUE);
+       return(TRUE);
 }
index 34008a638aab4fe683a209c1910a3c4a4697d268..da6cca9ab732dcb165be2616888bf538d8cbf5a9 100644 (file)
--- a/usleep.c
+++ b/usleep.c
@@ -38,5 +38,5 @@ extern int usleep_main(int argc, char **argv)
        }
 
        usleep(atoi(*(++argv)));        /* return void */
-       exit(TRUE);
+       return(TRUE);
 }
index c4f4fb408f6810c23f82ae0b236ac46095d9fca9..20846f7c657098ef3bb5335d50f8b7966682fb7c 100644 (file)
@@ -128,6 +128,5 @@ int dmesg_main(int argc, char **argv)
        exit(FALSE);
   klogctl_error:
        perror("klogctl");
-       exit(FALSE);
-
+       return(FALSE);
 }
index de4c82425fcf6f3396183d92deb8a8276444d9cc..0a84dce236b42e0b51d30181b24798c4e47b9e33 100644 (file)
@@ -329,5 +329,5 @@ extern int fbset_main(int argc, char **argv)
        /* Don't close the file, as exiting will take care of that */
        /* close(fh); */
 
-       exit (TRUE);
+       return (TRUE);
 }
index 4ec0a8886b9a6dfe35ff9a31c64e82afb488a677..81f0472c6400308a4b0d36308c291f7c8823ad31 100644 (file)
@@ -56,5 +56,5 @@ extern int fdflush_main(int argc, char **argv)
                perror(*argv);
                exit(FALSE);
        }
-       exit(TRUE);
+       return(TRUE);
 }
index cabe5660bf71bced636359d87a7326d396e90845..fdac5ea46094090b6ef77aec1721676e9a1e53d9 100644 (file)
@@ -58,7 +58,7 @@ freeramdisk_main(int argc, char **argv)
        /* Don't bother closing.  Exit does
         * that, so we can save a few bytes */
        /* close(f); */
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
index 7d76916f03be073d2bc8deb9d379963fb84c7ff3..fc37368f43d7ae872c5f955b41668353a7339519 100644 (file)
@@ -469,5 +469,5 @@ the -f option to force it.\n", program_name, device_name);
         */
        if (fsync(DEV))
                die("fsync failed");
-       exit(TRUE);
+       return(TRUE);
 }
index 549a417307e6d307f8cbb93f6522d19de25e95e8..13101657810d4e6da140a29232c0d73c98832675 100644 (file)
@@ -221,5 +221,5 @@ extern int more_main(int argc, char **argv)
 #ifdef BB_FEATURE_USE_TERMIOS
        gotsig(0);
 #endif
-       exit(TRUE);
+       return(TRUE);
 }
index 4216e336a6445ef4dc0566ae31808c4c234774f8..752497cb093641fdaff9decf7dce3779cac5ebb4 100644 (file)
@@ -346,5 +346,5 @@ int uudecode_main (int argc,
     }
     while (optind < argc);
   }
-  exit(exit_status);
+  return(exit_status);
 }
index 91136b3e6d557b2376d7aa0fc786403bf87515ab..97801aa097ec8b400e029ab2478bd18a619038b0 100644 (file)
@@ -240,5 +240,5 @@ int uuencode_main (int argc,
     errorMsg("Write error\n");
     exit FALSE;
   }
-  exit TRUE;
+  return( TRUE);
 }
diff --git a/wc.c b/wc.c
index 57bc7135a247591c258c20fdd951252a7afed398..bad03f79152fafb2be918ee223ccbf3eed4d67c5 100644 (file)
--- a/wc.c
+++ b/wc.c
@@ -166,5 +166,5 @@ int wc_main(int argc, char **argv)
                print_counts(total_lines, total_words, total_chars,
                                         max_length, "total");
        }
-       exit(TRUE);
+       return(TRUE);
 }
diff --git a/which.c b/which.c
index 7a11bf7876839390cb9a8f2b266427e4b9f57c76..8d4422a78d1d15ef18276b33b3691d8b466fcc75 100644 (file)
--- a/which.c
+++ b/which.c
@@ -88,7 +88,7 @@ extern int which_main(int argc, char **argv)
                        exit (FALSE);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }
 
 /*
index da584790d83e1e5c4ccc33263acf0084f5f50c3d..950f52fb2e54feefe7aab388a63b14b901c9c6c3 100644 (file)
--- a/whoami.c
+++ b/whoami.c
@@ -45,5 +45,5 @@ extern int whoami_main(int argc, char **argv)
        }
        fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0],
                        (unsigned) uid);
-       exit(FALSE);
+       return(FALSE);
 }