Stop using TRUE and FALSE for exit status.
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 88b5d13..a32ca79 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -73,7 +73,7 @@
if (n < 0) {
goto klogctl_error;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
if (bufsize < 4096)
@@ -98,11 +98,11 @@
}
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 8307f26..47130e3 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -434,7 +434,7 @@
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 @@
/* 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 6633e12..380015d 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -40,7 +40,7 @@
fd = open(*argv, 0);
if (fd < 0) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
value = ioctl(fd, FDFLUSH, 0);
@@ -50,7 +50,7 @@
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 22fc3e6..5671514 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -51,7 +51,7 @@
/* 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 627d04f..4757e15 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -176,7 +176,7 @@
void die(const char *str)
{
errorMsg("%s\n", str);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
void page_ok(int page)
@@ -325,7 +325,7 @@
} 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 @@
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 @@
"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 @@
*/
if (fsync(DEV))
die("fsync failed");
- return(TRUE);
+ return EXIT_SUCCESS;
}
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 8b115c9..34dbb5e 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -330,7 +330,7 @@
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 @@
free( mntentlist);
close(fd);
#endif
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#else
if (argc == 1) {
@@ -388,7 +388,7 @@
} else {
perror(mtab_file);
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#endif
@@ -489,7 +489,7 @@
&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 @@
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 @@
goto singlemount;
- exit(FALSE);
-
goodbye:
usage(mount_usage);
}
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 80b37de..7c8d541 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -101,7 +101,6 @@
default:
case 'H':
usage(rdate_usage);
- return(FALSE);
break;
case 's':
setdate++;
@@ -117,11 +116,10 @@
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 @@
fprintf(stdout, "%s", ctime(&time));
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 4a1c8f9..0ae0c36 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -50,7 +50,7 @@
if (status != 0) {
perror(applet_name);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
}
@@ -69,7 +69,7 @@
}
}
endmntent(f);
- exit(TRUE);
+ exit(EXIT_SUCCESS);
}
@@ -105,9 +105,8 @@
}
}
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 1d9c6bb..5f3e59c 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -273,11 +273,14 @@
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;
}