summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--applets/busybox.c18
-rw-r--r--archival/gunzip.c2
-rw-r--r--archival/gzip.c10
-rw-r--r--basename.c2
-rw-r--r--busybox.c18
-rw-r--r--cat.c2
-rw-r--r--chmod_chown_chgrp.c4
-rw-r--r--chvt.c2
-rw-r--r--clear.c2
-rw-r--r--console-tools/chvt.c2
-rw-r--r--console-tools/clear.c2
-rw-r--r--console-tools/deallocvt.c6
-rw-r--r--console-tools/loadacm.c5
-rw-r--r--console-tools/loadkmap.c2
-rw-r--r--console-tools/setkeycodes.c2
-rw-r--r--coreutils/basename.c2
-rw-r--r--coreutils/cat.c2
-rw-r--r--coreutils/cut.c2
-rw-r--r--coreutils/date.c3
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/dirname.c2
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/echo.c2
-rw-r--r--coreutils/head.c4
-rw-r--r--coreutils/hostid.c2
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/ln.c2
-rw-r--r--coreutils/logname.c2
-rw-r--r--coreutils/mkdir.c2
-rw-r--r--coreutils/mkfifo.c3
-rw-r--r--coreutils/mknod.c2
-rw-r--r--coreutils/pwd.c2
-rw-r--r--coreutils/rm.c2
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/sleep.c4
-rw-r--r--coreutils/sort.c4
-rw-r--r--coreutils/sync.c2
-rw-r--r--coreutils/tail.c2
-rw-r--r--coreutils/tee.c4
-rw-r--r--coreutils/test.c2
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/tty.c2
-rw-r--r--coreutils/uname.c2
-rw-r--r--coreutils/uniq.c4
-rw-r--r--coreutils/usleep.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/uuencode.c2
-rw-r--r--coreutils/wc.c2
-rw-r--r--coreutils/whoami.c2
-rw-r--r--cp_mv.c7
-rw-r--r--cut.c2
-rw-r--r--date.c3
-rw-r--r--deallocvt.c6
-rw-r--r--df.c2
-rw-r--r--dirname.c2
-rw-r--r--dmesg.c3
-rw-r--r--du.c4
-rw-r--r--dutmp.c2
-rw-r--r--echo.c2
-rw-r--r--editors/sed.c2
-rw-r--r--fbset.c2
-rw-r--r--fdflush.c2
-rw-r--r--find.c2
-rw-r--r--findutils/find.c2
-rw-r--r--findutils/grep.c2
-rw-r--r--findutils/which.c2
-rw-r--r--free.c2
-rw-r--r--freeramdisk.c2
-rw-r--r--grep.c2
-rw-r--r--gunzip.c2
-rw-r--r--gzip.c10
-rw-r--r--halt.c4
-rw-r--r--head.c4
-rw-r--r--hostid.c2
-rw-r--r--hostname.c4
-rw-r--r--id.c2
-rw-r--r--init/halt.c4
-rw-r--r--init/poweroff.c4
-rw-r--r--init/reboot.c4
-rw-r--r--internal.h1
-rw-r--r--lash.c3
-rw-r--r--ln.c2
-rw-r--r--loadacm.c5
-rw-r--r--loadkmap.c2
-rw-r--r--logger.c4
-rw-r--r--logname.c2
-rw-r--r--lsmod.c2
-rw-r--r--math.c2
-rw-r--r--miscutils/dutmp.c2
-rw-r--r--miscutils/mktemp.c2
-rw-r--r--miscutils/mt.c2
-rw-r--r--mkdir.c2
-rw-r--r--mkfifo.c3
-rw-r--r--mknod.c2
-rw-r--r--mkswap.c2
-rw-r--r--mktemp.c2
-rw-r--r--modutils/lsmod.c2
-rw-r--r--modutils/rmmod.c2
-rw-r--r--more.c2
-rw-r--r--mt.c2
-rw-r--r--networking/hostname.c4
-rw-r--r--networking/nslookup.c4
-rw-r--r--nslookup.c4
-rw-r--r--poweroff.c4
-rw-r--r--procps/free.c2
-rw-r--r--procps/ps.c2
-rw-r--r--procps/uptime.c2
-rw-r--r--ps.c2
-rw-r--r--pwd.c2
-rw-r--r--reboot.c4
-rw-r--r--rm.c2
-rw-r--r--rmdir.c2
-rw-r--r--rmmod.c2
-rw-r--r--sed.c2
-rw-r--r--setkeycodes.c2
-rw-r--r--sh.c3
-rw-r--r--shell/lash.c3
-rw-r--r--sleep.c4
-rw-r--r--sort.c4
-rw-r--r--sync.c2
-rw-r--r--sysklogd/logger.c4
-rw-r--r--tail.c2
-rw-r--r--tee.c4
-rw-r--r--test.c2
-rw-r--r--touch.c2
-rw-r--r--true_false.c4
-rw-r--r--tty.c2
-rw-r--r--uname.c2
-rw-r--r--uniq.c4
-rw-r--r--uptime.c2
-rw-r--r--usleep.c2
-rw-r--r--util-linux/dmesg.c3
-rw-r--r--util-linux/fbset.c2
-rw-r--r--util-linux/fdflush.c2
-rw-r--r--util-linux/freeramdisk.c2
-rw-r--r--util-linux/mkswap.c2
-rw-r--r--util-linux/more.c2
-rw-r--r--uudecode.c2
-rw-r--r--uuencode.c2
-rw-r--r--wc.c2
-rw-r--r--which.c2
-rw-r--r--whoami.c2
142 files changed, 190 insertions, 221 deletions
diff --git a/applets/busybox.c b/applets/busybox.c
index be9aa3e83..191dee13f 100644
--- a/applets/busybox.c
+++ b/applets/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/archival/gunzip.c b/archival/gunzip.c
index 78ee1d3c1..f2bb59dd7 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -746,7 +746,7 @@ int gunzip_main(int argc, char **argv)
exit(FALSE);
}
}
- exit(exit_code);
+ return(exit_code);
}
diff --git a/archival/gzip.c b/archival/gzip.c
index a971229d3..9248cfecd 100644
--- a/archival/gzip.c
+++ b/archival/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/basename.c b/basename.c
index 78265a5e6..ac371d274 100644
--- a/basename.c
+++ b/basename.c
@@ -60,6 +60,6 @@ extern int basename_main(int argc, char **argv)
s[m-n] = '\0';
}
printf("%s\n", s);
- exit(TRUE);
+ return(TRUE);
}
diff --git a/busybox.c b/busybox.c
index be9aa3e83..191dee13f 100644
--- 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 561b24f3f..800443460 100644
--- 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);
}
/*
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c
index 1ff4bde73..d3e267827 100644
--- a/chmod_chown_chgrp.c
+++ b/chmod_chown_chgrp.c
@@ -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 37fd21ae9..45a04397a 100644
--- 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 c27787ed3..dba105691 100644
--- 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);
}
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index 37fd21ae9..45a04397a 100644
--- a/console-tools/chvt.c
+++ b/console-tools/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/console-tools/clear.c b/console-tools/clear.c
index c27787ed3..dba105691 100644
--- a/console-tools/clear.c
+++ b/console-tools/clear.c
@@ -29,5 +29,5 @@
extern int clear_main(int argc, char **argv)
{
printf("\033[H\033[J");
- exit(TRUE);
+ return(TRUE);
}
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index a1b8e4eea..b65f7b098 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -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/console-tools/loadacm.c b/console-tools/loadacm.c
index cca5406ee..cf393d92d 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/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);
}
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 99efc5101..905741467 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -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);
}
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index e933e14bc..9062caf75 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -72,5 +72,5 @@ setkeycodes_main(int argc, char** argv)
argc -= 2;
argv += 2;
}
- exit( TRUE);
+ return( TRUE);
}
diff --git a/coreutils/basename.c b/coreutils/basename.c
index 78265a5e6..ac371d274 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -60,6 +60,6 @@ extern int basename_main(int argc, char **argv)
s[m-n] = '\0';
}
printf("%s\n", s);
- exit(TRUE);
+ return(TRUE);
}
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 561b24f3f..800443460 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -61,7 +61,7 @@ extern int cat_main(int argc, char **argv)
}
print_file(file);
}
- exit(TRUE);
+ return(TRUE);
}
/*
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 89a934e76..7b183e8fd 100644
--- a/coreutils/cut.c
+++ b/coreutils/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/coreutils/date.c b/coreutils/date.c
index 8e584cecc..9e8e3f3eb 100644
--- a/coreutils/date.c
+++ b/coreutils/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);
}
diff --git a/coreutils/df.c b/coreutils/df.c
index 07e61d87d..ba3227f30 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -108,7 +108,7 @@ extern int df_main(int argc, char **argv)
endmntent(mountTable);
}
- exit(TRUE);
+ return(TRUE);
}
/*
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index ce3cd6f03..847842eab 100644
--- a/coreutils/dirname.c
+++ b/coreutils/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/coreutils/du.c b/coreutils/du.c
index 9c699978e..b8e296ddd 100644
--- a/coreutils/du.c
+++ b/coreutils/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/coreutils/echo.c b/coreutils/echo.c
index b31f2229b..4659e4bc6 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -96,7 +96,7 @@ echo_main(int argc, char** argv)
if (! nflag)
putchar('\n');
fflush(stdout);
- exit( 0);
+ return( 0);
}
/*-
diff --git a/coreutils/head.c b/coreutils/head.c
index f4ebe05c9..f42f4837d 100644
--- a/coreutils/head.c
+++ b/coreutils/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 $ */
diff --git a/coreutils/hostid.c b/coreutils/hostid.c
index 9e503e598..f1010a65d 100644
--- a/coreutils/hostid.c
+++ b/coreutils/hostid.c
@@ -26,5 +26,5 @@
extern int hostid_main(int argc, char **argv)
{
printf("%lx\n", gethostid());
- exit(TRUE);
+ return(TRUE);
}
diff --git a/coreutils/id.c b/coreutils/id.c
index 23bbc16ae..69dfe2658 100644
--- a/coreutils/id.c
+++ b/coreutils/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);
}
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 371482251..2233a1d68 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -136,7 +136,7 @@ extern int ln_main(int argc, char **argv)
exit FALSE;
}
}
- exit TRUE;
+ return( TRUE);
}
/*
diff --git a/coreutils/logname.c b/coreutils/logname.c
index 7c6153f64..4b4483cc1 100644
--- a/coreutils/logname.c
+++ b/coreutils/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/coreutils/mkdir.c b/coreutils/mkdir.c
index 96649868d..b18c949b8 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -112,5 +112,5 @@ extern int mkdir_main(int argc, char **argv)
argc--;
argv++;
}
- exit TRUE;
+ return( TRUE);
}
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index 46b1343cd..f701a97d5 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/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/coreutils/mknod.c b/coreutils/mknod.c
index 8f411a341..ac96817ee 100644
--- a/coreutils/mknod.c
+++ b/coreutils/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);
}
diff --git a/coreutils/pwd.c b/coreutils/pwd.c
index 146ef332b..87553b3de 100644
--- a/coreutils/pwd.c
+++ b/coreutils/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);
}
diff --git a/coreutils/rm.c b/coreutils/rm.c
index b1cda3aed..2067d878c 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -112,5 +112,5 @@ extern int rm_main(int argc, char **argv)
}
}
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 61d7f2aa5..0751808c0 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -44,5 +44,5 @@ extern int rmdir_main(int argc, char **argv)
exit(FALSE);
}
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 13f07c02f..c7ab32d4b 100644
--- a/coreutils/sleep.c
+++ b/coreutils/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/coreutils/sort.c b/coreutils/sort.c
index 1edc7d1ca..93062faa4 100644
--- a/coreutils/sort.c
+++ b/coreutils/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/coreutils/sync.c b/coreutils/sync.c
index 33c79228d..db35d72fa 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -33,5 +33,5 @@ extern int sync_main(int argc, char **argv)
#endif
);
}
- exit(sync());
+ return(sync());
}
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 2027d921d..3189d204f 100644
--- a/coreutils/tail.c
+++ b/coreutils/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/coreutils/tee.c b/coreutils/tee.c
index a78edc039..c9b5410d3 100644
--- a/coreutils/tee.c
+++ b/coreutils/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/coreutils/test.c b/coreutils/test.c
index 0a16e9328..36da4db0b 100644
--- a/coreutils/test.c
+++ b/coreutils/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/coreutils/touch.c b/coreutils/touch.c
index 1364bb7d5..f52bb0284 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -81,5 +81,5 @@ extern int touch_main(int argc, char **argv)
argv++;
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/coreutils/tty.c b/coreutils/tty.c
index 3a318ebba..f3c7fb74f 100644
--- a/coreutils/tty.c
+++ b/coreutils/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/coreutils/uname.c b/coreutils/uname.c
index 981ac69ed..b7c88ece5 100644
--- a/coreutils/uname.c
+++ b/coreutils/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/coreutils/uniq.c b/coreutils/uniq.c
index 0cccbd5e7..64acf046a 100644
--- a/coreutils/uniq.c
+++ b/coreutils/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 $ */
diff --git a/coreutils/usleep.c b/coreutils/usleep.c
index 34008a638..da6cca9ab 100644
--- a/coreutils/usleep.c
+++ b/coreutils/usleep.c
@@ -38,5 +38,5 @@ extern int usleep_main(int argc, char **argv)
}
usleep(atoi(*(++argv))); /* return void */
- exit(TRUE);
+ return(TRUE);
}
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 4216e336a..752497cb0 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -346,5 +346,5 @@ int uudecode_main (int argc,
}
while (optind < argc);
}
- exit(exit_status);
+ return(exit_status);
}
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 91136b3e6..97801aa09 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -240,5 +240,5 @@ int uuencode_main (int argc,
errorMsg("Write error\n");
exit FALSE;
}
- exit TRUE;
+ return( TRUE);
}
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 57bc7135a..bad03f791 100644
--- a/coreutils/wc.c
+++ b/coreutils/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/coreutils/whoami.c b/coreutils/whoami.c
index da584790d..950f52fb2 100644
--- a/coreutils/whoami.c
+++ b/coreutils/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);
}
diff --git a/cp_mv.c b/cp_mv.c
index c8d6562f1..b15235a25 100644
--- 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 89a934e76..7b183e8fd 100644
--- 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 8e584cecc..9e8e3f3eb 100644
--- 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);
}
diff --git a/deallocvt.c b/deallocvt.c
index a1b8e4eea..b65f7b098 100644
--- a/deallocvt.c
+++ b/deallocvt.c
@@ -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 07e61d87d..ba3227f30 100644
--- a/df.c
+++ b/df.c
@@ -108,7 +108,7 @@ extern int df_main(int argc, char **argv)
endmntent(mountTable);
}
- exit(TRUE);
+ return(TRUE);
}
/*
diff --git a/dirname.c b/dirname.c
index ce3cd6f03..847842eab 100644
--- 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 c4f4fb408..20846f7c6 100644
--- 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 9c699978e..b8e296ddd 100644
--- 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 f264fd75b..c6bc0c794 100644
--- 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 b31f2229b..4659e4bc6 100644
--- 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);
}
/*-
diff --git a/editors/sed.c b/editors/sed.c
index 955858f7f..d4b721e49 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -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 de4c82425..0a84dce23 100644
--- 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);
}
diff --git a/fdflush.c b/fdflush.c
index 4ec0a8886..81f0472c6 100644
--- 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 53b85e6b3..329d15193 100644
--- a/find.c
+++ b/find.c
@@ -116,5 +116,5 @@ int find_main(int argc, char **argv)
exit(FALSE);
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/findutils/find.c b/findutils/find.c
index 53b85e6b3..329d15193 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -116,5 +116,5 @@ int find_main(int argc, char **argv)
exit(FALSE);
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/findutils/grep.c b/findutils/grep.c
index b91fe7c2c..0e495ff87 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -163,7 +163,7 @@ extern int grep_main(int argc, char **argv)
fclose(fp);
}
}
- exit(match);
+ return(match);
}
diff --git a/findutils/which.c b/findutils/which.c
index 7a11bf787..8d4422a78 100644
--- a/findutils/which.c
+++ b/findutils/which.c
@@ -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 e6f130ea9..a81189be9 100644
--- 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);
}
diff --git a/freeramdisk.c b/freeramdisk.c
index cabe5660b..fdac5ea46 100644
--- a/freeramdisk.c
+++ b/freeramdisk.c
@@ -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 b91fe7c2c..0e495ff87 100644
--- a/grep.c
+++ b/grep.c
@@ -163,7 +163,7 @@ extern int grep_main(int argc, char **argv)
fclose(fp);
}
}
- exit(match);
+ return(match);
}
diff --git a/gunzip.c b/gunzip.c
index 78ee1d3c1..f2bb59dd7 100644
--- 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 a971229d3..9248cfecd 100644
--- 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 bcd69b952..2ca36d038 100644
--- 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 f4ebe05c9..f42f4837d 100644
--- 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 $ */
diff --git a/hostid.c b/hostid.c
index 9e503e598..f1010a65d 100644
--- 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);
}
diff --git a/hostname.c b/hostname.c
index 0df9fed75..e909138e4 100644
--- a/hostname.c
+++ b/hostname.c
@@ -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 23bbc16ae..69dfe2658 100644
--- 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);
}
diff --git a/init/halt.c b/init/halt.c
index bcd69b952..2ca36d038 100644
--- a/init/halt.c
+++ b/init/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/init/poweroff.c b/init/poweroff.c
index bc8e67716..126a0fb94 100644
--- a/init/poweroff.c
+++ b/init/poweroff.c
@@ -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
}
diff --git a/init/reboot.c b/init/reboot.c
index 6e1f3d53b..bde8dbd77 100644
--- a/init/reboot.c
+++ b/init/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/internal.h b/internal.h
index 9997f4dc4..fce32c415 100644
--- a/internal.h
+++ b/internal.h
@@ -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 8ea5e305b..56d94258c 100644
--- 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 371482251..2233a1d68 100644
--- a/ln.c
+++ b/ln.c
@@ -136,7 +136,7 @@ extern int ln_main(int argc, char **argv)
exit FALSE;
}
}
- exit TRUE;
+ return( TRUE);
}
/*
diff --git a/loadacm.c b/loadacm.c
index cca5406ee..cf393d92d 100644
--- 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);
}
diff --git a/loadkmap.c b/loadkmap.c
index 99efc5101..905741467 100644
--- a/loadkmap.c
+++ b/loadkmap.c
@@ -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);
}
diff --git a/logger.c b/logger.c
index 118a5ded0..d32ccaaf3 100644
--- 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);
}
diff --git a/logname.c b/logname.c
index 7c6153f64..4b4483cc1 100644
--- 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 9b72275cd..d3b1bb79e 100644
--- 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 621b5c9b0..eb8f331fd 100644
--- a/math.c
+++ b/math.c
@@ -186,5 +186,5 @@ int math_main(int argc, char **argv)
}
}
stack_machine(0);
- exit( TRUE);
+ return( TRUE);
}
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index f264fd75b..c6bc0c794 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/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/miscutils/mktemp.c b/miscutils/mktemp.c
index b30b9a08f..87792cb18 100644
--- a/miscutils/mktemp.c
+++ b/miscutils/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);
}
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 44f23884c..304d66485 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -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 96649868d..b18c949b8 100644
--- a/mkdir.c
+++ b/mkdir.c
@@ -112,5 +112,5 @@ extern int mkdir_main(int argc, char **argv)
argc--;
argv++;
}
- exit TRUE;
+ return( TRUE);
}
diff --git a/mkfifo.c b/mkfifo.c
index 46b1343cd..f701a97d5 100644
--- 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 8f411a341..ac96817ee 100644
--- 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);
}
diff --git a/mkswap.c b/mkswap.c
index 7d76916f0..fc37368f4 100644
--- 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);
}
diff --git a/mktemp.c b/mktemp.c
index b30b9a08f..87792cb18 100644
--- 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);
}
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 9b72275cd..d3b1bb79e 100644
--- a/modutils/lsmod.c
+++ b/modutils/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/modutils/rmmod.c b/modutils/rmmod.c
index 5ef4a60f8..a73d789f2 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -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 549a41730..131016578 100644
--- 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 44f23884c..304d66485 100644
--- a/mt.c
+++ b/mt.c
@@ -101,5 +101,5 @@ extern int mt_main(int argc, char **argv)
exit (FALSE);
}
- exit (TRUE);
+ return (TRUE);
}
diff --git a/networking/hostname.c b/networking/hostname.c
index 0df9fed75..e909138e4 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -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/networking/nslookup.c b/networking/nslookup.c
index 82bcf56a1..54f37c848 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -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 $ */
diff --git a/nslookup.c b/nslookup.c
index 82bcf56a1..54f37c848 100644
--- a/nslookup.c
+++ b/nslookup.c
@@ -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 $ */
diff --git a/poweroff.c b/poweroff.c
index bc8e67716..126a0fb94 100644
--- a/poweroff.c
+++ b/poweroff.c
@@ -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
}
diff --git a/procps/free.c b/procps/free.c
index e6f130ea9..a81189be9 100644
--- a/procps/free.c
+++ b/procps/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);
}
diff --git a/procps/ps.c b/procps/ps.c
index 41b8465bd..13b6ce541 100644
--- a/procps/ps.c
+++ b/procps/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/procps/uptime.c b/procps/uptime.c
index af54158c9..67ca34d75 100644
--- a/procps/uptime.c
+++ b/procps/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);
}
diff --git a/ps.c b/ps.c
index 41b8465bd..13b6ce541 100644
--- 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 146ef332b..87553b3de 100644
--- 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);
}
diff --git a/reboot.c b/reboot.c
index 6e1f3d53b..bde8dbd77 100644
--- 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 b1cda3aed..2067d878c 100644
--- 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 61d7f2aa5..0751808c0 100644
--- 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 5ef4a60f8..a73d789f2 100644
--- 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 955858f7f..d4b721e49 100644
--- a/sed.c
+++ b/sed.c
@@ -352,7 +352,7 @@ extern int sed_main(int argc, char **argv)
fclose(fp);
}
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/setkeycodes.c b/setkeycodes.c
index e933e14bc..9062caf75 100644
--- a/setkeycodes.c
+++ b/setkeycodes.c
@@ -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 8ea5e305b..56d94258c 100644
--- 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 */
diff --git a/shell/lash.c b/shell/lash.c
index 8ea5e305b..56d94258c 100644
--- a/shell/lash.c
+++ b/shell/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/sleep.c b/sleep.c
index 13f07c02f..c7ab32d4b 100644
--- 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 1edc7d1ca..93062faa4 100644
--- 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 33c79228d..db35d72fa 100644
--- a/sync.c
+++ b/sync.c
@@ -33,5 +33,5 @@ extern int sync_main(int argc, char **argv)
#endif
);
}
- exit(sync());
+ return(sync());
}
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 118a5ded0..d32ccaaf3 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/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);
}
diff --git a/tail.c b/tail.c
index 2027d921d..3189d204f 100644
--- 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 a78edc039..c9b5410d3 100644
--- 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 0a16e9328..36da4db0b 100644
--- 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 1364bb7d5..f52bb0284 100644
--- a/touch.c
+++ b/touch.c
@@ -81,5 +81,5 @@ extern int touch_main(int argc, char **argv)
argv++;
}
- exit(TRUE);
+ return(TRUE);
}
diff --git a/true_false.c b/true_false.c
index 5ae221b3a..c56f5e7af 100644
--- a/true_false.c
+++ b/true_false.c
@@ -27,10 +27,10 @@
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 3a318ebba..f3c7fb74f 100644
--- 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 981ac69ed..b7c88ece5 100644
--- 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 0cccbd5e7..64acf046a 100644
--- 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 $ */
diff --git a/uptime.c b/uptime.c
index af54158c9..67ca34d75 100644
--- 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);
}
diff --git a/usleep.c b/usleep.c
index 34008a638..da6cca9ab 100644
--- 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);
}
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index c4f4fb408..20846f7c6 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/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/util-linux/fbset.c b/util-linux/fbset.c
index de4c82425..0a84dce23 100644
--- a/util-linux/fbset.c
+++ b/util-linux/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);
}
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index 4ec0a8886..81f0472c6 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/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/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index cabe5660b..fdac5ea46 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -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/util-linux/mkswap.c b/util-linux/mkswap.c
index 7d76916f0..fc37368f4 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/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);
}
diff --git a/util-linux/more.c b/util-linux/more.c
index 549a41730..131016578 100644
--- a/util-linux/more.c
+++ b/util-linux/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/uudecode.c b/uudecode.c
index 4216e336a..752497cb0 100644
--- a/uudecode.c
+++ b/uudecode.c
@@ -346,5 +346,5 @@ int uudecode_main (int argc,
}
while (optind < argc);
}
- exit(exit_status);
+ return(exit_status);
}
diff --git a/uuencode.c b/uuencode.c
index 91136b3e6..97801aa09 100644
--- a/uuencode.c
+++ b/uuencode.c
@@ -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 57bc7135a..bad03f791 100644
--- 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 7a11bf787..8d4422a78 100644
--- a/which.c
+++ b/which.c
@@ -88,7 +88,7 @@ extern int which_main(int argc, char **argv)
exit (FALSE);
}
}
- exit(TRUE);
+ return(TRUE);
}
/*
diff --git a/whoami.c b/whoami.c
index da584790d..950f52fb2 100644
--- 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);
}