aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2000-12-01 02:55:13 +0000
committerMatt Kraai <kraai@debian.org>2000-12-01 02:55:13 +0000
commit3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0 (patch)
tree013a1e7752113314831ad7d51854ce8dc9e0918b /util-linux
parentb558e76eb1ba173ce3501c3e13fb80f426a7faac (diff)
downloadbusybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.gz
busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.bz2
busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.zip
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)
73 if (n < 0) { 73 if (n < 0) {
74 goto klogctl_error; 74 goto klogctl_error;
75 } 75 }
76 exit(TRUE); 76 return EXIT_SUCCESS;
77 } 77 }
78 78
79 if (bufsize < 4096) 79 if (bufsize < 4096)
@@ -98,11 +98,11 @@ int dmesg_main(int argc, char **argv)
98 } 98 }
99 if (lastc != '\n') 99 if (lastc != '\n')
100 putchar('\n'); 100 putchar('\n');
101 exit(TRUE); 101 return EXIT_SUCCESS;
102 end: 102 end:
103 usage(dmesg_usage); 103 usage(dmesg_usage);
104 exit(FALSE); 104 return EXIT_FAILURE;
105 klogctl_error: 105 klogctl_error:
106 perror("klogctl"); 106 perror("klogctl");
107 return(FALSE); 107 return EXIT_FAILURE;
108} 108}
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)
434 if (g_options & OPT_READMODE) { 434 if (g_options & OPT_READMODE) {
435 if (!readmode(&var, modefile, mode)) { 435 if (!readmode(&var, modefile, mode)) {
436 errorMsg("Unknown video mode `%s'\n", mode); 436 errorMsg("Unknown video mode `%s'\n", mode);
437 exit(1); 437 return EXIT_FAILURE;
438 } 438 }
439 } 439 }
440 440
@@ -446,5 +446,5 @@ extern int fbset_main(int argc, char **argv)
446 /* Don't close the file, as exiting will take care of that */ 446 /* Don't close the file, as exiting will take care of that */
447 /* close(fh); */ 447 /* close(fh); */
448 448
449 return (TRUE); 449 return EXIT_SUCCESS;
450} 450}
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)
40 fd = open(*argv, 0); 40 fd = open(*argv, 0);
41 if (fd < 0) { 41 if (fd < 0) {
42 perror(*argv); 42 perror(*argv);
43 exit(FALSE); 43 return EXIT_FAILURE;
44 } 44 }
45 45
46 value = ioctl(fd, FDFLUSH, 0); 46 value = ioctl(fd, FDFLUSH, 0);
@@ -50,7 +50,7 @@ extern int fdflush_main(int argc, char **argv)
50 50
51 if (value) { 51 if (value) {
52 perror(*argv); 52 perror(*argv);
53 exit(FALSE); 53 return EXIT_FAILURE;
54 } 54 }
55 return(TRUE); 55 return EXIT_SUCCESS;
56} 56}
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)
51 /* Don't bother closing. Exit does 51 /* Don't bother closing. Exit does
52 * that, so we can save a few bytes */ 52 * that, so we can save a few bytes */
53 /* close(f); */ 53 /* close(f); */
54 return(TRUE); 54 return EXIT_SUCCESS;
55} 55}
56 56
57/* 57/*
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)
176void die(const char *str) 176void die(const char *str)
177{ 177{
178 errorMsg("%s\n", str); 178 errorMsg("%s\n", str);
179 exit(FALSE); 179 exit(EXIT_FAILURE);
180} 180}
181 181
182void page_ok(int page) 182void page_ok(int page)
@@ -325,7 +325,7 @@ int mkswap_main(int argc, char **argv)
325 } else if (PAGES > sz && !force) { 325 } else if (PAGES > sz && !force) {
326 errorMsg("error: size %ld is larger than device size %d\n", 326 errorMsg("error: size %ld is larger than device size %d\n",
327 PAGES * (pagesize / 1024), sz * (pagesize / 1024)); 327 PAGES * (pagesize / 1024), sz * (pagesize / 1024));
328 exit(FALSE); 328 return EXIT_FAILURE;
329 } 329 }
330 330
331 if (version == -1) { 331 if (version == -1) {
@@ -369,7 +369,7 @@ int mkswap_main(int argc, char **argv)
369 DEV = open(device_name, O_RDWR); 369 DEV = open(device_name, O_RDWR);
370 if (DEV < 0 || fstat(DEV, &statbuf) < 0) { 370 if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
371 perror(device_name); 371 perror(device_name);
372 exit(FALSE); 372 return EXIT_FAILURE;
373 } 373 }
374 if (!S_ISBLK(statbuf.st_mode)) 374 if (!S_ISBLK(statbuf.st_mode))
375 check = 0; 375 check = 0;
@@ -393,7 +393,7 @@ int mkswap_main(int argc, char **argv)
393"This probably means creating v0 swap would destroy your partition table\n" 393"This probably means creating v0 swap would destroy your partition table\n"
394"No swap created. If you really want to create swap v0 on that device, use\n" 394"No swap created. If you really want to create swap v0 on that device, use\n"
395"the -f option to force it.\n", device_name); 395"the -f option to force it.\n", device_name);
396 exit(FALSE); 396 return EXIT_FAILURE;
397 } 397 }
398 } 398 }
399 } 399 }
@@ -429,5 +429,5 @@ int mkswap_main(int argc, char **argv)
429 */ 429 */
430 if (fsync(DEV)) 430 if (fsync(DEV))
431 die("fsync failed"); 431 die("fsync failed");
432 return(TRUE); 432 return EXIT_SUCCESS;
433} 433}
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)
330 int fakeIt = FALSE; 330 int fakeIt = FALSE;
331 int useMtab = TRUE; 331 int useMtab = TRUE;
332 int i; 332 int i;
333 int rc = FALSE; 333 int rc = EXIT_FAILURE;
334 int fstabmount = FALSE; 334 int fstabmount = FALSE;
335 335
336#if defined BB_FEATURE_USE_DEVPS_PATCH 336#if defined BB_FEATURE_USE_DEVPS_PATCH
@@ -367,7 +367,7 @@ extern int mount_main(int argc, char **argv)
367 free( mntentlist); 367 free( mntentlist);
368 close(fd); 368 close(fd);
369#endif 369#endif
370 exit(TRUE); 370 return EXIT_SUCCESS;
371 } 371 }
372#else 372#else
373 if (argc == 1) { 373 if (argc == 1) {
@@ -388,7 +388,7 @@ extern int mount_main(int argc, char **argv)
388 } else { 388 } else {
389 perror(mtab_file); 389 perror(mtab_file);
390 } 390 }
391 exit(TRUE); 391 return EXIT_SUCCESS;
392 } 392 }
393#endif 393#endif
394 394
@@ -489,7 +489,7 @@ singlemount:
489 &extra_opts, &string_flags, 1); 489 &extra_opts, &string_flags, 1);
490 if ( rc != 0) { 490 if ( rc != 0) {
491 fatalError("nfsmount failed: %s\n", strerror(errno)); 491 fatalError("nfsmount failed: %s\n", strerror(errno));
492 rc = FALSE; 492 rc = EXIT_FAILURE;
493 } 493 }
494 } 494 }
495#endif 495#endif
@@ -499,7 +499,7 @@ singlemount:
499 if (all == FALSE) 499 if (all == FALSE)
500 break; 500 break;
501 501
502 rc = TRUE; // Always return 0 for 'all' 502 rc = EXIT_SUCCESS; // Always return 0 for 'all'
503 } 503 }
504 if (fstabmount == TRUE) 504 if (fstabmount == TRUE)
505 endmntent(f); 505 endmntent(f);
@@ -512,8 +512,6 @@ singlemount:
512 512
513 goto singlemount; 513 goto singlemount;
514 514
515 exit(FALSE);
516
517goodbye: 515goodbye:
518 usage(mount_usage); 516 usage(mount_usage);
519} 517}
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)
101 default: 101 default:
102 case 'H': 102 case 'H':
103 usage(rdate_usage); 103 usage(rdate_usage);
104 return(FALSE);
105 break; 104 break;
106 case 's': 105 case 's':
107 setdate++; 106 setdate++;
@@ -117,11 +116,10 @@ int rdate_main(int argc, char **argv)
117 116
118 if (optind == argc) { 117 if (optind == argc) {
119 usage(rdate_usage); 118 usage(rdate_usage);
120 return(FALSE);
121 } 119 }
122 120
123 if ((time= askremotedate(argv[optind])) == (time_t)-1) { 121 if ((time= askremotedate(argv[optind])) == (time_t)-1) {
124 return(FALSE); 122 return EXIT_FAILURE;
125 } 123 }
126 if (setdate) { 124 if (setdate) {
127 if (stime(&time) < 0) 125 if (stime(&time) < 0)
@@ -131,5 +129,5 @@ int rdate_main(int argc, char **argv)
131 fprintf(stdout, "%s", ctime(&time)); 129 fprintf(stdout, "%s", ctime(&time));
132 } 130 }
133 131
134 return(TRUE); 132 return EXIT_SUCCESS;
135} 133}
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)
50 50
51 if (status != 0) { 51 if (status != 0) {
52 perror(applet_name); 52 perror(applet_name);
53 exit(FALSE); 53 exit(EXIT_FAILURE);
54 } 54 }
55} 55}
56 56
@@ -69,7 +69,7 @@ static void do_em_all()
69 } 69 }
70 } 70 }
71 endmntent(f); 71 endmntent(f);
72 exit(TRUE); 72 exit(EXIT_SUCCESS);
73} 73}
74 74
75 75
@@ -105,9 +105,8 @@ extern int swap_on_off_main(int argc, char **argv)
105 } 105 }
106 } 106 }
107 swap_enable_disable(*argv); 107 swap_enable_disable(*argv);
108 exit(TRUE); 108 return EXIT_SUCCESS;
109 109
110 usage_and_exit: 110 usage_and_exit:
111 usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage); 111 usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage);
112 exit(FALSE);
113} 112}
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)
273 273
274 mtab_read(); 274 mtab_read();
275 if (umountAll == TRUE) { 275 if (umountAll == TRUE) {
276 exit(umount_all(useMtab)); 276 if (umount_all(useMtab) == TRUE)
277 return EXIT_SUCCESS;
278 else
279 return EXIT_FAILURE;
277 } 280 }
278 if (do_umount(*argv, useMtab) == 0) 281 if (do_umount(*argv, useMtab) == 0)
279 exit(TRUE); 282 return EXIT_SUCCESS;
280 perror("umount"); 283 perror("umount");
281 return(FALSE); 284 return EXIT_FAILURE;
282} 285}
283 286