aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorGravatar Matt Kraai <kraai@debian.org>2000-12-01 02:55:13 +0000
committerGravatar Matt Kraai <kraai@debian.org>2000-12-01 02:55:13 +0000
commit3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0 (patch)
tree013a1e7752113314831ad7d51854ce8dc9e0918b /util-linux
parentb558e76eb1ba173ce3501c3e13fb80f426a7faac (diff)
downloadbusybox-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.gz
busybox-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.bz2
Stop using TRUE and FALSE for exit status.
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/dmesg.c8
-rw-r--r--util-linux/fbset.c4
-rw-r--r--util-linux/fdflush.c6
-rw-r--r--util-linux/freeramdisk.c2
-rw-r--r--util-linux/mkswap.c10
-rw-r--r--util-linux/mount.c12
-rw-r--r--util-linux/rdate.c6
-rw-r--r--util-linux/swaponoff.c7
-rw-r--r--util-linux/umount.c9
9 files changed, 31 insertions, 33 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 88b5d1393..a32ca79dc 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -73,7 +73,7 @@ int dmesg_main(int argc, char **argv)
if (n < 0) {
goto klogctl_error;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
if (bufsize < 4096)
@@ -98,11 +98,11 @@ int dmesg_main(int argc, char **argv)
}
if (lastc != '\n')
putchar('\n');
- exit(TRUE);
+ return EXIT_SUCCESS;
end:
usage(dmesg_usage);
- exit(FALSE);
+ return EXIT_FAILURE;
klogctl_error:
perror("klogctl");
- return(FALSE);
+ return EXIT_FAILURE;
}
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 8307f262d..47130e355 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
errorMsg("Unknown video mode `%s'\n", mode);
- exit(1);
+ return EXIT_FAILURE;
}
}
@@ -446,5 +446,5 @@ extern int fbset_main(int argc, char **argv)
/* Don't close the file, as exiting will take care of that */
/* close(fh); */
- return (TRUE);
+ return EXIT_SUCCESS;
}
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index 6633e1212..380015dde 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -40,7 +40,7 @@ extern int fdflush_main(int argc, char **argv)
fd = open(*argv, 0);
if (fd < 0) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
value = ioctl(fd, FDFLUSH, 0);
@@ -50,7 +50,7 @@ extern int fdflush_main(int argc, char **argv)
if (value) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 22fc3e643..567151455 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -51,7 +51,7 @@ freeramdisk_main(int argc, char **argv)
/* Don't bother closing. Exit does
* that, so we can save a few bytes */
/* close(f); */
- return(TRUE);
+ return EXIT_SUCCESS;
}
/*
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 627d04f60..4757e15f8 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -176,7 +176,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr)
void die(const char *str)
{
errorMsg("%s\n", str);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
void page_ok(int page)
@@ -325,7 +325,7 @@ int mkswap_main(int argc, char **argv)
} else if (PAGES > sz && !force) {
errorMsg("error: size %ld is larger than device size %d\n",
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (version == -1) {
@@ -369,7 +369,7 @@ int mkswap_main(int argc, char **argv)
DEV = open(device_name, O_RDWR);
if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
perror(device_name);
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (!S_ISBLK(statbuf.st_mode))
check = 0;
@@ -393,7 +393,7 @@ int mkswap_main(int argc, char **argv)
"This probably means creating v0 swap would destroy your partition table\n"
"No swap created. If you really want to create swap v0 on that device, use\n"
"the -f option to force it.\n", device_name);
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
}
@@ -429,5 +429,5 @@ int mkswap_main(int argc, char **argv)
*/
if (fsync(DEV))
die("fsync failed");
- return(TRUE);
+ return EXIT_SUCCESS;
}
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 8b115c9f5..34dbb5eee 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -330,7 +330,7 @@ extern int mount_main(int argc, char **argv)
int fakeIt = FALSE;
int useMtab = TRUE;
int i;
- int rc = FALSE;
+ int rc = EXIT_FAILURE;
int fstabmount = FALSE;
#if defined BB_FEATURE_USE_DEVPS_PATCH
@@ -367,7 +367,7 @@ extern int mount_main(int argc, char **argv)
free( mntentlist);
close(fd);
#endif
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#else
if (argc == 1) {
@@ -388,7 +388,7 @@ extern int mount_main(int argc, char **argv)
} else {
perror(mtab_file);
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#endif
@@ -489,7 +489,7 @@ singlemount:
&extra_opts, &string_flags, 1);
if ( rc != 0) {
fatalError("nfsmount failed: %s\n", strerror(errno));
- rc = FALSE;
+ rc = EXIT_FAILURE;
}
}
#endif
@@ -499,7 +499,7 @@ singlemount:
if (all == FALSE)
break;
- rc = TRUE; // Always return 0 for 'all'
+ rc = EXIT_SUCCESS; // Always return 0 for 'all'
}
if (fstabmount == TRUE)
endmntent(f);
@@ -512,8 +512,6 @@ singlemount:
goto singlemount;
- exit(FALSE);
-
goodbye:
usage(mount_usage);
}
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 80b37de37..7c8d54117 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -101,7 +101,6 @@ int rdate_main(int argc, char **argv)
default:
case 'H':
usage(rdate_usage);
- return(FALSE);
break;
case 's':
setdate++;
@@ -117,11 +116,10 @@ int rdate_main(int argc, char **argv)
if (optind == argc) {
usage(rdate_usage);
- return(FALSE);
}
if ((time= askremotedate(argv[optind])) == (time_t)-1) {
- return(FALSE);
+ return EXIT_FAILURE;
}
if (setdate) {
if (stime(&time) < 0)
@@ -131,5 +129,5 @@ int rdate_main(int argc, char **argv)
fprintf(stdout, "%s", ctime(&time));
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 4a1c8f93f..0ae0c36ee 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -50,7 +50,7 @@ static void swap_enable_disable(char *device)
if (status != 0) {
perror(applet_name);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
}
@@ -69,7 +69,7 @@ static void do_em_all()
}
}
endmntent(f);
- exit(TRUE);
+ exit(EXIT_SUCCESS);
}
@@ -105,9 +105,8 @@ extern int swap_on_off_main(int argc, char **argv)
}
}
swap_enable_disable(*argv);
- exit(TRUE);
+ return EXIT_SUCCESS;
usage_and_exit:
usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage);
- exit(FALSE);
}
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 1d9c6bb32..5f3e59caf 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -273,11 +273,14 @@ extern int umount_main(int argc, char **argv)
mtab_read();
if (umountAll == TRUE) {
- exit(umount_all(useMtab));
+ if (umount_all(useMtab) == TRUE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
}
if (do_umount(*argv, useMtab) == 0)
- exit(TRUE);
+ return EXIT_SUCCESS;
perror("umount");
- return(FALSE);
+ return EXIT_FAILURE;
}