diff options
author | Matt Kraai <kraai@debian.org> | 2000-12-01 02:55:13 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-12-01 02:55:13 +0000 |
commit | 3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0 (patch) | |
tree | 013a1e7752113314831ad7d51854ce8dc9e0918b | |
parent | b558e76eb1ba173ce3501c3e13fb80f426a7faac (diff) | |
download | busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.gz busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.bz2 busybox-w32-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.zip |
Stop using TRUE and FALSE for exit status.
132 files changed, 375 insertions, 373 deletions
@@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv) | |||
387 | } | 387 | } |
388 | extractList=extractList->next; | 388 | extractList=extractList->next; |
389 | } | 389 | } |
390 | return (TRUE); | 390 | return EXIT_SUCCESS; |
391 | } | 391 | } |
diff --git a/archival/ar.c b/archival/ar.c index f3ba59b6a..0f16ec88c 100644 --- a/archival/ar.c +++ b/archival/ar.c | |||
@@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv) | |||
387 | } | 387 | } |
388 | extractList=extractList->next; | 388 | extractList=extractList->next; |
389 | } | 389 | } |
390 | return (TRUE); | 390 | return EXIT_SUCCESS; |
391 | } | 391 | } |
diff --git a/archival/gunzip.c b/archival/gunzip.c index 70b25bdb0..eeff9774a 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c | |||
@@ -1350,7 +1350,7 @@ int gunzip_main(int argc, char **argv) | |||
1350 | 1350 | ||
1351 | if (delInputFile == 1 && unlink(delFileName) < 0) { | 1351 | if (delInputFile == 1 && unlink(delFileName) < 0) { |
1352 | perror(delFileName); | 1352 | perror(delFileName); |
1353 | exit(FALSE); | 1353 | return EXIT_FAILURE; |
1354 | } | 1354 | } |
1355 | } | 1355 | } |
1356 | return(exit_code); | 1356 | return(exit_code); |
diff --git a/archival/gzip.c b/archival/gzip.c index 2e147b1ca..d8c22a924 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -1930,7 +1930,7 @@ int gzip_main(int argc, char **argv) | |||
1930 | 1930 | ||
1931 | if (unlink(delFileName) < 0) { | 1931 | if (unlink(delFileName) < 0) { |
1932 | perror(delFileName); | 1932 | perror(delFileName); |
1933 | exit(FALSE); | 1933 | exit(EXIT_FAILURE); |
1934 | } | 1934 | } |
1935 | } | 1935 | } |
1936 | 1936 | ||
diff --git a/archival/tar.c b/archival/tar.c index 826ab9665..01997e464 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -156,6 +156,7 @@ extern int tar_main(int argc, char **argv) | |||
156 | int tostdoutFlag = FALSE; | 156 | int tostdoutFlag = FALSE; |
157 | int firstOpt = TRUE; | 157 | int firstOpt = TRUE; |
158 | int stopIt; | 158 | int stopIt; |
159 | int status; | ||
159 | 160 | ||
160 | 161 | ||
161 | if (argc <= 1) | 162 | if (argc <= 1) |
@@ -227,16 +228,21 @@ extern int tar_main(int argc, char **argv) | |||
227 | #ifndef BB_FEATURE_TAR_CREATE | 228 | #ifndef BB_FEATURE_TAR_CREATE |
228 | fatalError( "This version of tar was not compiled with tar creation support.\n"); | 229 | fatalError( "This version of tar was not compiled with tar creation support.\n"); |
229 | #else | 230 | #else |
230 | exit(writeTarFile(tarName, verboseFlag, argv, excludeList)); | 231 | status = writeTarFile(tarName, verboseFlag, argv, excludeList); |
231 | #endif | 232 | #endif |
232 | } | 233 | } |
233 | if (listFlag == TRUE || extractFlag == TRUE) { | 234 | if (listFlag == TRUE || extractFlag == TRUE) { |
234 | if (*argv) | 235 | if (*argv) |
235 | extractList = argv; | 236 | extractList = argv; |
236 | exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, | 237 | status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, |
237 | verboseFlag, extractList, excludeList)); | 238 | verboseFlag, extractList, excludeList); |
238 | } | 239 | } |
239 | 240 | ||
241 | if (status == TRUE) | ||
242 | return EXIT_SUCCESS; | ||
243 | else | ||
244 | return EXIT_FAILURE; | ||
245 | |||
240 | flagError: | 246 | flagError: |
241 | fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n"); | 247 | fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n"); |
242 | } | 248 | } |
diff --git a/basename.c b/basename.c index 4d9fc4ec0..fcc7d4619 100644 --- a/basename.c +++ b/basename.c | |||
@@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv) | |||
45 | s[m-n] = '\0'; | 45 | s[m-n] = '\0'; |
46 | } | 46 | } |
47 | printf("%s\n", s); | 47 | printf("%s\n", s); |
48 | return(TRUE); | 48 | return EXIT_SUCCESS; |
49 | } | 49 | } |
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c index 1ec7eec6c..e8ccb8156 100644 --- a/chmod_chown_chgrp.c +++ b/chmod_chown_chgrp.c | |||
@@ -161,9 +161,9 @@ int chmod_chown_chgrp_main(int argc, char **argv) | |||
161 | while (argc-- > 1) { | 161 | while (argc-- > 1) { |
162 | if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE, | 162 | if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE, |
163 | fileAction, fileAction, NULL) == FALSE) | 163 | fileAction, fileAction, NULL) == FALSE) |
164 | exit(FALSE); | 164 | return EXIT_FAILURE; |
165 | } | 165 | } |
166 | exit(TRUE); | 166 | return EXIT_SUCCESS; |
167 | 167 | ||
168 | bad_group: | 168 | bad_group: |
169 | fatalError( "unknown group name: %s\n", groupName); | 169 | fatalError( "unknown group name: %s\n", groupName); |
@@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv) | |||
54 | execlp(prog, prog, NULL); | 54 | execlp(prog, prog, NULL); |
55 | #else | 55 | #else |
56 | shell_main(argc, argv); | 56 | shell_main(argc, argv); |
57 | exit (0); | 57 | return EXIT_SUCCESS; |
58 | #endif | 58 | #endif |
59 | } | 59 | } |
60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); | 60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); |
@@ -25,13 +25,13 @@ int chvt_main(int argc, char **argv) | |||
25 | num = atoi(argv[1]); | 25 | num = atoi(argv[1]); |
26 | if (ioctl(fd, VT_ACTIVATE, num)) { | 26 | if (ioctl(fd, VT_ACTIVATE, num)) { |
27 | perror("VT_ACTIVATE"); | 27 | perror("VT_ACTIVATE"); |
28 | exit(FALSE); | 28 | return EXIT_FAILURE; |
29 | } | 29 | } |
30 | if (ioctl(fd, VT_WAITACTIVE, num)) { | 30 | if (ioctl(fd, VT_WAITACTIVE, num)) { |
31 | perror("VT_WAITACTIVE"); | 31 | perror("VT_WAITACTIVE"); |
32 | exit(FALSE); | 32 | return EXIT_FAILURE; |
33 | } | 33 | } |
34 | return(TRUE); | 34 | return EXIT_SUCCESS; |
35 | } | 35 | } |
36 | 36 | ||
37 | 37 | ||
@@ -29,5 +29,5 @@ | |||
29 | extern int clear_main(int argc, char **argv) | 29 | extern int clear_main(int argc, char **argv) |
30 | { | 30 | { |
31 | printf("\033[H\033[J"); | 31 | printf("\033[H\033[J"); |
32 | return(TRUE); | 32 | return EXIT_SUCCESS; |
33 | } | 33 | } |
@@ -135,7 +135,7 @@ void clean_up_and_die(int sig) | |||
135 | cmdedit_reset_term(); | 135 | cmdedit_reset_term(); |
136 | fprintf(stdout, "\n"); | 136 | fprintf(stdout, "\n"); |
137 | if (sig!=SIGINT) | 137 | if (sig!=SIGINT) |
138 | exit(TRUE); | 138 | exit(EXIT_SUCCESS); |
139 | } | 139 | } |
140 | 140 | ||
141 | /* Go to HOME position */ | 141 | /* Go to HOME position */ |
@@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv) | |||
54 | else | 54 | else |
55 | printf("%s %s differ: char %d, line %d\n", filename1, filename2, | 55 | printf("%s %s differ: char %d, line %d\n", filename1, filename2, |
56 | char_pos, line_pos); | 56 | char_pos, line_pos); |
57 | return 1; | 57 | return EXIT_FAILURE; |
58 | } | 58 | } |
59 | char_pos++; | 59 | char_pos++; |
60 | if (c1 == '\n') | 60 | if (c1 == '\n') |
diff --git a/console-tools/chvt.c b/console-tools/chvt.c index d4b16a05d..790964586 100644 --- a/console-tools/chvt.c +++ b/console-tools/chvt.c | |||
@@ -25,13 +25,13 @@ int chvt_main(int argc, char **argv) | |||
25 | num = atoi(argv[1]); | 25 | num = atoi(argv[1]); |
26 | if (ioctl(fd, VT_ACTIVATE, num)) { | 26 | if (ioctl(fd, VT_ACTIVATE, num)) { |
27 | perror("VT_ACTIVATE"); | 27 | perror("VT_ACTIVATE"); |
28 | exit(FALSE); | 28 | return EXIT_FAILURE; |
29 | } | 29 | } |
30 | if (ioctl(fd, VT_WAITACTIVE, num)) { | 30 | if (ioctl(fd, VT_WAITACTIVE, num)) { |
31 | perror("VT_WAITACTIVE"); | 31 | perror("VT_WAITACTIVE"); |
32 | exit(FALSE); | 32 | return EXIT_FAILURE; |
33 | } | 33 | } |
34 | return(TRUE); | 34 | return EXIT_SUCCESS; |
35 | } | 35 | } |
36 | 36 | ||
37 | 37 | ||
diff --git a/console-tools/clear.c b/console-tools/clear.c index 4a8e0450f..ca83f3820 100644 --- a/console-tools/clear.c +++ b/console-tools/clear.c | |||
@@ -29,5 +29,5 @@ | |||
29 | extern int clear_main(int argc, char **argv) | 29 | extern int clear_main(int argc, char **argv) |
30 | { | 30 | { |
31 | printf("\033[H\033[J"); | 31 | printf("\033[H\033[J"); |
32 | return(TRUE); | 32 | return EXIT_SUCCESS; |
33 | } | 33 | } |
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index 65af79b77..4600c0d05 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c | |||
@@ -28,7 +28,7 @@ printf("erik: A\n"); | |||
28 | /* deallocate all unused consoles */ | 28 | /* deallocate all unused consoles */ |
29 | if (ioctl(fd, VT_DISALLOCATE, 0)) { | 29 | if (ioctl(fd, VT_DISALLOCATE, 0)) { |
30 | perror("VT_DISALLOCATE"); | 30 | perror("VT_DISALLOCATE"); |
31 | exit( FALSE); | 31 | return EXIT_FAILURE; |
32 | } | 32 | } |
33 | } else | 33 | } else |
34 | printf("erik: B\n"); | 34 | printf("erik: B\n"); |
@@ -44,5 +44,5 @@ printf("erik: B\n"); | |||
44 | } | 44 | } |
45 | } | 45 | } |
46 | printf("erik: C\n"); | 46 | printf("erik: C\n"); |
47 | return( TRUE); | 47 | return EXIT_SUCCESS; |
48 | } | 48 | } |
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index 2d989dfc4..77689fc84 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c | |||
@@ -51,7 +51,7 @@ int dumpkmap_main(int argc, char **argv) | |||
51 | fd = open("/dev/tty0", O_RDWR); | 51 | fd = open("/dev/tty0", O_RDWR); |
52 | if (fd < 0) { | 52 | if (fd < 0) { |
53 | errorMsg("Error opening /dev/tty0: %s\n", strerror(errno)); | 53 | errorMsg("Error opening /dev/tty0: %s\n", strerror(errno)); |
54 | return 1; | 54 | return EXIT_FAILURE; |
55 | } | 55 | } |
56 | 56 | ||
57 | write(1, magic, 7); | 57 | write(1, magic, 7); |
@@ -88,5 +88,5 @@ int dumpkmap_main(int argc, char **argv) | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | close(fd); | 90 | close(fd); |
91 | return 0; | 91 | return EXIT_SUCCESS; |
92 | } | 92 | } |
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c index f57737925..156210890 100644 --- a/console-tools/loadacm.c +++ b/console-tools/loadacm.c | |||
@@ -40,17 +40,17 @@ int loadacm_main(int argc, char **argv) | |||
40 | fd = open("/dev/tty", O_RDWR); | 40 | fd = open("/dev/tty", O_RDWR); |
41 | if (fd < 0) { | 41 | if (fd < 0) { |
42 | errorMsg("Error opening /dev/tty1: %s\n", strerror(errno)); | 42 | errorMsg("Error opening /dev/tty1: %s\n", strerror(errno)); |
43 | return( FALSE); | 43 | return EXIT_FAILURE; |
44 | } | 44 | } |
45 | 45 | ||
46 | if (screen_map_load(fd, stdin)) { | 46 | if (screen_map_load(fd, stdin)) { |
47 | errorMsg("Error loading acm: %s\n", strerror(errno)); | 47 | errorMsg("Error loading acm: %s\n", strerror(errno)); |
48 | return( FALSE); | 48 | return EXIT_FAILURE; |
49 | } | 49 | } |
50 | 50 | ||
51 | write(fd, "\033(K", 3); | 51 | write(fd, "\033(K", 3); |
52 | 52 | ||
53 | return( TRUE); | 53 | return EXIT_SUCCESS; |
54 | } | 54 | } |
55 | 55 | ||
56 | int screen_map_load(int fd, FILE * fp) | 56 | int screen_map_load(int fd, FILE * fp) |
diff --git a/console-tools/reset.c b/console-tools/reset.c index 8e2c491e2..bf8c3ed45 100644 --- a/console-tools/reset.c +++ b/console-tools/reset.c | |||
@@ -29,6 +29,6 @@ | |||
29 | extern int reset_main(int argc, char **argv) | 29 | extern int reset_main(int argc, char **argv) |
30 | { | 30 | { |
31 | printf("\033c"); | 31 | printf("\033c"); |
32 | return(TRUE); | 32 | return EXIT_SUCCESS; |
33 | } | 33 | } |
34 | 34 | ||
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c index 63c106333..6a31e042a 100644 --- a/console-tools/setkeycodes.c +++ b/console-tools/setkeycodes.c | |||
@@ -68,5 +68,5 @@ setkeycodes_main(int argc, char** argv) | |||
68 | argc -= 2; | 68 | argc -= 2; |
69 | argv += 2; | 69 | argv += 2; |
70 | } | 70 | } |
71 | return( TRUE); | 71 | return EXIT_SUCCESS; |
72 | } | 72 | } |
diff --git a/coreutils/basename.c b/coreutils/basename.c index 4d9fc4ec0..fcc7d4619 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
@@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv) | |||
45 | s[m-n] = '\0'; | 45 | s[m-n] = '\0'; |
46 | } | 46 | } |
47 | printf("%s\n", s); | 47 | printf("%s\n", s); |
48 | return(TRUE); | 48 | return EXIT_SUCCESS; |
49 | } | 49 | } |
diff --git a/coreutils/chroot.c b/coreutils/chroot.c index f0a298104..f279af18d 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c | |||
@@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv) | |||
54 | execlp(prog, prog, NULL); | 54 | execlp(prog, prog, NULL); |
55 | #else | 55 | #else |
56 | shell_main(argc, argv); | 56 | shell_main(argc, argv); |
57 | exit (0); | 57 | return EXIT_SUCCESS; |
58 | #endif | 58 | #endif |
59 | } | 59 | } |
60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); | 60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); |
diff --git a/coreutils/cmp.c b/coreutils/cmp.c index 98b747eed..6b955447c 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c | |||
@@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv) | |||
54 | else | 54 | else |
55 | printf("%s %s differ: char %d, line %d\n", filename1, filename2, | 55 | printf("%s %s differ: char %d, line %d\n", filename1, filename2, |
56 | char_pos, line_pos); | 56 | char_pos, line_pos); |
57 | return 1; | 57 | return EXIT_FAILURE; |
58 | } | 58 | } |
59 | char_pos++; | 59 | char_pos++; |
60 | if (c1 == '\n') | 60 | if (c1 == '\n') |
diff --git a/coreutils/cut.c b/coreutils/cut.c index 2d313cc24..b281fa234 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv) | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | return 0; | 244 | return EXIT_SUCCESS; |
245 | } | 245 | } |
diff --git a/coreutils/date.c b/coreutils/date.c index 7e4216768..2e69bde4a 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -232,7 +232,7 @@ int date_main(int argc, char **argv) | |||
232 | } else if (*date_fmt == '\0') { | 232 | } else if (*date_fmt == '\0') { |
233 | /* Imitate what GNU 'date' does with NO format string! */ | 233 | /* Imitate what GNU 'date' does with NO format string! */ |
234 | printf("\n"); | 234 | printf("\n"); |
235 | exit(TRUE); | 235 | return EXIT_SUCCESS; |
236 | } | 236 | } |
237 | 237 | ||
238 | /* Handle special conversions */ | 238 | /* Handle special conversions */ |
@@ -246,5 +246,5 @@ int date_main(int argc, char **argv) | |||
246 | strftime(t_buff, 200, date_fmt, &tm_time); | 246 | strftime(t_buff, 200, date_fmt, &tm_time); |
247 | printf("%s\n", t_buff); | 247 | printf("%s\n", t_buff); |
248 | 248 | ||
249 | return(TRUE); | 249 | return EXIT_SUCCESS; |
250 | } | 250 | } |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 2b77ea6a5..044f167c3 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv) | |||
174 | (inTotal % blockSize) != 0); | 174 | (inTotal % blockSize) != 0); |
175 | printf("%ld+%d records out\n", (long) (outTotal / blockSize), | 175 | printf("%ld+%d records out\n", (long) (outTotal / blockSize), |
176 | (outTotal % blockSize) != 0); | 176 | (outTotal % blockSize) != 0); |
177 | exit(TRUE); | 177 | return EXIT_SUCCESS; |
178 | usage: | 178 | usage: |
179 | 179 | ||
180 | usage(dd_usage); | 180 | usage(dd_usage); |
diff --git a/coreutils/df.c b/coreutils/df.c index 8d6242c56..aefffc771 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv) | |||
79 | exit(FALSE); | 79 | exit(FALSE); |
80 | } | 80 | } |
81 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); | 81 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); |
82 | if (status != 0) | 82 | if (status != TRUE) |
83 | exit(status); | 83 | return EXIT_FAILURE; |
84 | argc--; | 84 | argc--; |
85 | argv++; | 85 | argv++; |
86 | } | 86 | } |
87 | exit(TRUE); | 87 | return EXIT_SUCCESS; |
88 | } else { | 88 | } else { |
89 | FILE *mountTable; | 89 | FILE *mountTable; |
90 | struct mntent *mountEntry; | 90 | struct mntent *mountEntry; |
@@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv) | |||
92 | mountTable = setmntent(mtab_file, "r"); | 92 | mountTable = setmntent(mtab_file, "r"); |
93 | if (mountTable == 0) { | 93 | if (mountTable == 0) { |
94 | perror(mtab_file); | 94 | perror(mtab_file); |
95 | exit(FALSE); | 95 | return EXIT_FAILURE; |
96 | } | 96 | } |
97 | 97 | ||
98 | while ((mountEntry = getmntent(mountTable))) { | 98 | while ((mountEntry = getmntent(mountTable))) { |
@@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv) | |||
101 | endmntent(mountTable); | 101 | endmntent(mountTable); |
102 | } | 102 | } |
103 | 103 | ||
104 | return(TRUE); | 104 | return EXIT_FAILURE; |
105 | } | 105 | } |
106 | 106 | ||
107 | /* | 107 | /* |
diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 23f46be40..ceb750cb8 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c | |||
@@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv) | |||
40 | if (s && *s) | 40 | if (s && *s) |
41 | *s = '\0'; | 41 | *s = '\0'; |
42 | printf("%s\n", (s)? *argv : "."); | 42 | printf("%s\n", (s)? *argv : "."); |
43 | return(TRUE); | 43 | return EXIT_SUCCESS; |
44 | } | 44 | } |
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index c9f783f1a..ed2088e4e 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c | |||
@@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) { | |||
41 | putchar(c); | 41 | putchar(c); |
42 | c = getchar(); | 42 | c = getchar(); |
43 | } | 43 | } |
44 | return 0; | 44 | return EXIT_SUCCESS; |
45 | } | 45 | } |
diff --git a/coreutils/du.c b/coreutils/du.c index 408ad994c..a0f1606fe 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -160,10 +160,10 @@ int du_main(int argc, char **argv) | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | return(0); | 163 | return EXIT_SUCCESS; |
164 | } | 164 | } |
165 | 165 | ||
166 | /* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */ | 166 | /* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */ |
167 | /* | 167 | /* |
168 | Local Variables: | 168 | Local Variables: |
169 | c-file-style: "linux" | 169 | c-file-style: "linux" |
diff --git a/coreutils/echo.c b/coreutils/echo.c index a6b5152d8..393f4425f 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -107,7 +107,7 @@ just_echo: | |||
107 | putchar('\n'); | 107 | putchar('\n'); |
108 | fflush(stdout); | 108 | fflush(stdout); |
109 | 109 | ||
110 | return 0; | 110 | return EXIT_SUCCESS; |
111 | } | 111 | } |
112 | 112 | ||
113 | /*- | 113 | /*- |
diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 47bd8d724..35a5859c4 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c | |||
@@ -26,5 +26,5 @@ | |||
26 | extern int hostid_main(int argc, char **argv) | 26 | extern int hostid_main(int argc, char **argv) |
27 | { | 27 | { |
28 | printf("%lx\n", gethostid()); | 28 | printf("%lx\n", gethostid()); |
29 | return(TRUE); | 29 | return EXIT_SUCCESS; |
30 | } | 30 | } |
diff --git a/coreutils/length.c b/coreutils/length.c index 14d15c81c..1ab4e3a58 100644 --- a/coreutils/length.c +++ b/coreutils/length.c | |||
@@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv) | |||
9 | if (argc != 2 || **(argv + 1) == '-') | 9 | if (argc != 2 || **(argv + 1) == '-') |
10 | usage(length_usage); | 10 | usage(length_usage); |
11 | printf("%lu\n", (long)strlen(argv[1])); | 11 | printf("%lu\n", (long)strlen(argv[1])); |
12 | return (TRUE); | 12 | return EXIT_SUCCESS; |
13 | } | 13 | } |
diff --git a/coreutils/ls.c b/coreutils/ls.c index d508a1bfe..225132ba4 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv) | |||
878 | 878 | ||
879 | print_usage_message: | 879 | print_usage_message: |
880 | usage(ls_usage); | 880 | usage(ls_usage); |
881 | return(FALSE); | ||
882 | } | 881 | } |
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c index 21570de93..30b882ab5 100644 --- a/coreutils/md5sum.c +++ b/coreutils/md5sum.c | |||
@@ -902,22 +902,22 @@ int md5sum_main(int argc, | |||
902 | 902 | ||
903 | if (file_type_specified && do_check) { | 903 | if (file_type_specified && do_check) { |
904 | errorMsg("the -b and -t options are meaningless when verifying checksums\n"); | 904 | errorMsg("the -b and -t options are meaningless when verifying checksums\n"); |
905 | exit FALSE; | 905 | return EXIT_FAILURE; |
906 | } | 906 | } |
907 | 907 | ||
908 | if (n_strings > 0 && do_check) { | 908 | if (n_strings > 0 && do_check) { |
909 | errorMsg("the -g and -c options are mutually exclusive\n"); | 909 | errorMsg("the -g and -c options are mutually exclusive\n"); |
910 | exit FALSE; | 910 | return EXIT_FAILURE; |
911 | } | 911 | } |
912 | 912 | ||
913 | if (status_only && !do_check) { | 913 | if (status_only && !do_check) { |
914 | errorMsg("the -s option is meaningful only when verifying checksums\n"); | 914 | errorMsg("the -s option is meaningful only when verifying checksums\n"); |
915 | exit FALSE; | 915 | return EXIT_FAILURE; |
916 | } | 916 | } |
917 | 917 | ||
918 | if (warn && !do_check) { | 918 | if (warn && !do_check) { |
919 | errorMsg("the -w option is meaningful only when verifying checksums\n"); | 919 | errorMsg("the -w option is meaningful only when verifying checksums\n"); |
920 | exit FALSE; | 920 | return EXIT_FAILURE; |
921 | } | 921 | } |
922 | 922 | ||
923 | if (n_strings > 0) { | 923 | if (n_strings > 0) { |
@@ -925,7 +925,7 @@ int md5sum_main(int argc, | |||
925 | 925 | ||
926 | if (optind < argc) { | 926 | if (optind < argc) { |
927 | errorMsg("no files may be specified when using -g\n"); | 927 | errorMsg("no files may be specified when using -g\n"); |
928 | exit FALSE; | 928 | return EXIT_FAILURE; |
929 | } | 929 | } |
930 | for (i = 0; i < n_strings; ++i) { | 930 | for (i = 0; i < n_strings; ++i) { |
931 | size_t cnt; | 931 | size_t cnt; |
@@ -992,13 +992,16 @@ int md5sum_main(int argc, | |||
992 | 992 | ||
993 | if (fclose (stdout) == EOF) { | 993 | if (fclose (stdout) == EOF) { |
994 | errorMsg("write error\n"); | 994 | errorMsg("write error\n"); |
995 | exit FALSE; | 995 | return EXIT_FAILURE; |
996 | } | 996 | } |
997 | 997 | ||
998 | if (have_read_stdin && fclose (stdin) == EOF) { | 998 | if (have_read_stdin && fclose (stdin) == EOF) { |
999 | errorMsg("standard input\n"); | 999 | errorMsg("standard input\n"); |
1000 | exit FALSE; | 1000 | return EXIT_FAILURE; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | exit (err == 0 ? TRUE : FALSE); | 1003 | if (err == 0) |
1004 | return EXIT_SUCCESS; | ||
1005 | else | ||
1006 | return EXIT_FAILURE; | ||
1004 | } | 1007 | } |
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 04310e4c7..c950847dc 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
@@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv) | |||
51 | mode = 0; | 51 | mode = 0; |
52 | if (parse_mode(*(++argv), &mode) == FALSE) { | 52 | if (parse_mode(*(++argv), &mode) == FALSE) { |
53 | errorMsg("Unknown mode: %s\n", *argv); | 53 | errorMsg("Unknown mode: %s\n", *argv); |
54 | exit FALSE; | 54 | return EXIT_FAILURE; |
55 | } | 55 | } |
56 | /* Set the umask for this process so it doesn't | 56 | /* Set the umask for this process so it doesn't |
57 | * screw up whatever the user just entered. */ | 57 | * screw up whatever the user just entered. */ |
@@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv) | |||
80 | 80 | ||
81 | if (strlen(*argv) > BUFSIZ - 1) { | 81 | if (strlen(*argv) > BUFSIZ - 1) { |
82 | errorMsg(name_too_long); | 82 | errorMsg(name_too_long); |
83 | exit FALSE; | 83 | return EXIT_FAILURE; |
84 | } | 84 | } |
85 | strcpy(buf, *argv); | 85 | strcpy(buf, *argv); |
86 | status = stat(buf, &statBuf); | 86 | status = stat(buf, &statBuf); |
87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { | 87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { |
88 | errorMsg("%s: File exists\n", buf); | 88 | errorMsg("%s: File exists\n", buf); |
89 | exit FALSE; | 89 | return EXIT_FAILURE; |
90 | } | 90 | } |
91 | if (parentFlag == TRUE) { | 91 | if (parentFlag == TRUE) { |
92 | strcat(buf, "/"); | 92 | strcat(buf, "/"); |
@@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv) | |||
94 | } else { | 94 | } else { |
95 | if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { | 95 | if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { |
96 | perror(buf); | 96 | perror(buf); |
97 | exit FALSE; | 97 | return EXIT_FAILURE; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | argc--; | 100 | argc--; |
101 | argv++; | 101 | argv++; |
102 | } | 102 | } |
103 | return( TRUE); | 103 | return EXIT_SUCCESS; |
104 | } | 104 | } |
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 5e1bc1a78..ef4a5256f 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c | |||
@@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv) | |||
55 | usage(mkfifo_usage); | 55 | usage(mkfifo_usage); |
56 | if (mkfifo(*argv, mode) < 0) { | 56 | if (mkfifo(*argv, mode) < 0) { |
57 | perror("mkfifo"); | 57 | perror("mkfifo"); |
58 | exit(255); | 58 | return EXIT_FAILURE; |
59 | } | 59 | } |
60 | return(TRUE); | 60 | return EXIT_SUCCESS; |
61 | } | 61 | } |
diff --git a/coreutils/mknod.c b/coreutils/mknod.c index ecb0e4780..21b2689cc 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c | |||
@@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv) | |||
85 | 85 | ||
86 | if (mknod(argv[0], mode, dev) != 0) | 86 | if (mknod(argv[0], mode, dev) != 0) |
87 | fatalError("%s: %s\n", argv[0], strerror(errno)); | 87 | fatalError("%s: %s\n", argv[0], strerror(errno)); |
88 | return (TRUE); | 88 | return EXIT_SUCCESS; |
89 | } | 89 | } |
90 | 90 | ||
diff --git a/coreutils/pwd.c b/coreutils/pwd.c index c9de7778e..54129b175 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c | |||
@@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv) | |||
34 | fatalError("%s\n", strerror(errno)); | 34 | fatalError("%s\n", strerror(errno)); |
35 | 35 | ||
36 | printf("%s\n", buf); | 36 | printf("%s\n", buf); |
37 | return(TRUE); | 37 | return EXIT_SUCCESS; |
38 | } | 38 | } |
diff --git a/coreutils/rm.c b/coreutils/rm.c index 4f97cad23..c62083e9b 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c | |||
@@ -102,9 +102,9 @@ extern int rm_main(int argc, char **argv) | |||
102 | } else { | 102 | } else { |
103 | if (recursiveAction(srcName, recursiveFlag, FALSE, | 103 | if (recursiveAction(srcName, recursiveFlag, FALSE, |
104 | TRUE, fileAction, dirAction, NULL) == FALSE) { | 104 | TRUE, fileAction, dirAction, NULL) == FALSE) { |
105 | exit(FALSE); | 105 | return EXIT_FAILURE; |
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | return(TRUE); | 109 | return EXIT_SUCCESS; |
110 | } | 110 | } |
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 709e3de34..ad92b106d 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c | |||
@@ -32,7 +32,7 @@ extern int sleep_main(int argc, char **argv) | |||
32 | 32 | ||
33 | if (sleep(atoi(*(++argv))) != 0) { | 33 | if (sleep(atoi(*(++argv))) != 0) { |
34 | perror("sleep"); | 34 | perror("sleep"); |
35 | exit(FALSE); | 35 | return EXIT_FAILURE; |
36 | } | 36 | } |
37 | return(TRUE); | 37 | return EXIT_SUCCESS; |
38 | } | 38 | } |
diff --git a/coreutils/touch.c b/coreutils/touch.c index 7db6c6e33..5537fb63b 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c | |||
@@ -43,7 +43,6 @@ extern int touch_main(int argc, char **argv) | |||
43 | break; | 43 | break; |
44 | default: | 44 | default: |
45 | usage(touch_usage); | 45 | usage(touch_usage); |
46 | exit(FALSE); | ||
47 | } | 46 | } |
48 | } | 47 | } |
49 | } | 48 | } |
@@ -57,7 +56,7 @@ extern int touch_main(int argc, char **argv) | |||
57 | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | 56 | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); |
58 | if (fd < 0) { | 57 | if (fd < 0) { |
59 | if (create == FALSE && errno == ENOENT) | 58 | if (create == FALSE && errno == ENOENT) |
60 | exit(TRUE); | 59 | return EXIT_SUCCESS; |
61 | else { | 60 | else { |
62 | fatalError("%s", strerror(errno)); | 61 | fatalError("%s", strerror(errno)); |
63 | } | 62 | } |
@@ -70,5 +69,5 @@ extern int touch_main(int argc, char **argv) | |||
70 | argv++; | 69 | argv++; |
71 | } | 70 | } |
72 | 71 | ||
73 | return(TRUE); | 72 | return EXIT_SUCCESS; |
74 | } | 73 | } |
diff --git a/coreutils/tty.c b/coreutils/tty.c index 6eebed9fb..46201d3e6 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c | |||
@@ -38,5 +38,5 @@ extern int tty_main(int argc, char **argv) | |||
38 | else | 38 | else |
39 | puts("not a tty"); | 39 | puts("not a tty"); |
40 | } | 40 | } |
41 | return(isatty(0) ? TRUE : FALSE); | 41 | return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE); |
42 | } | 42 | } |
diff --git a/coreutils/uname.c b/coreutils/uname.c index 8d9427c86..2781b80b3 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -138,7 +138,7 @@ int uname_main(int argc, char **argv) | |||
138 | print_element(PRINT_MACHINE, name.machine); | 138 | print_element(PRINT_MACHINE, name.machine); |
139 | print_element(PRINT_PROCESSOR, processor); | 139 | print_element(PRINT_PROCESSOR, processor); |
140 | 140 | ||
141 | return(TRUE); | 141 | return EXIT_SUCCESS; |
142 | } | 142 | } |
143 | 143 | ||
144 | /* If the name element set in MASK is selected for printing in `toprint', | 144 | /* If the name element set in MASK is selected for printing in `toprint', |
diff --git a/coreutils/usleep.c b/coreutils/usleep.c index 69790ef09..86dc0501b 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c | |||
@@ -32,5 +32,5 @@ extern int usleep_main(int argc, char **argv) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | usleep(atoi(*(++argv))); /* return void */ | 34 | usleep(atoi(*(++argv))); /* return void */ |
35 | return(TRUE); | 35 | return EXIT_SUCCESS; |
36 | } | 36 | } |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 78ca0968d..825fdb562 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -294,16 +294,16 @@ int uudecode_main (int argc, | |||
294 | } | 294 | } |
295 | 295 | ||
296 | if (optind == argc) | 296 | if (optind == argc) |
297 | exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE; | 297 | exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE; |
298 | else { | 298 | else { |
299 | exit_status = TRUE; | 299 | exit_status = EXIT_SUCCESS; |
300 | do { | 300 | do { |
301 | if (freopen (argv[optind], "r", stdin) != NULL) { | 301 | if (freopen (argv[optind], "r", stdin) != NULL) { |
302 | if (decode (argv[optind], outname) != 0) | 302 | if (decode (argv[optind], outname) != 0) |
303 | exit_status = FALSE; | 303 | exit_status = FALSE; |
304 | } else { | 304 | } else { |
305 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 305 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); |
306 | exit_status = FALSE; | 306 | exit_status = EXIT_FAILURE; |
307 | } | 307 | } |
308 | optind++; | 308 | optind++; |
309 | } | 309 | } |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index aea99ed87..8d15adbf6 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -179,7 +179,7 @@ int uuencode_main (int argc, | |||
179 | /* Optional first argument is input file. */ | 179 | /* Optional first argument is input file. */ |
180 | if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { | 180 | if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { |
181 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 181 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); |
182 | exit FALSE; | 182 | return EXIT_FAILURE; |
183 | } | 183 | } |
184 | mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); | 184 | mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); |
185 | optind++; | 185 | optind++; |
@@ -200,9 +200,9 @@ int uuencode_main (int argc, | |||
200 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); | 200 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); |
201 | if (ferror (stdout)) { | 201 | if (ferror (stdout)) { |
202 | errorMsg("Write error\n"); | 202 | errorMsg("Write error\n"); |
203 | exit FALSE; | 203 | return EXIT_FAILURE; |
204 | } | 204 | } |
205 | return( TRUE); | 205 | return EXIT_SUCCESS; |
206 | } | 206 | } |
207 | 207 | ||
208 | /* Copyright (c) 1983 Regents of the University of California. | 208 | /* Copyright (c) 1983 Regents of the University of California. |
@@ -316,9 +316,9 @@ extern int cp_mv_main(int argc, char **argv) | |||
316 | if (flags_memo) | 316 | if (flags_memo) |
317 | *(baseDestName + baseDestLen) = '\0'; | 317 | *(baseDestName + baseDestLen) = '\0'; |
318 | } | 318 | } |
319 | return( TRUE); | 319 | return EXIT_SUCCESS; |
320 | exit_false: | 320 | exit_false: |
321 | return( FALSE); | 321 | return EXIT_FAILURE; |
322 | } | 322 | } |
323 | 323 | ||
324 | /* | 324 | /* |
@@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv) | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | return 0; | 244 | return EXIT_SUCCESS; |
245 | } | 245 | } |
@@ -232,7 +232,7 @@ int date_main(int argc, char **argv) | |||
232 | } else if (*date_fmt == '\0') { | 232 | } else if (*date_fmt == '\0') { |
233 | /* Imitate what GNU 'date' does with NO format string! */ | 233 | /* Imitate what GNU 'date' does with NO format string! */ |
234 | printf("\n"); | 234 | printf("\n"); |
235 | exit(TRUE); | 235 | return EXIT_SUCCESS; |
236 | } | 236 | } |
237 | 237 | ||
238 | /* Handle special conversions */ | 238 | /* Handle special conversions */ |
@@ -246,5 +246,5 @@ int date_main(int argc, char **argv) | |||
246 | strftime(t_buff, 200, date_fmt, &tm_time); | 246 | strftime(t_buff, 200, date_fmt, &tm_time); |
247 | printf("%s\n", t_buff); | 247 | printf("%s\n", t_buff); |
248 | 248 | ||
249 | return(TRUE); | 249 | return EXIT_SUCCESS; |
250 | } | 250 | } |
@@ -13,19 +13,15 @@ static unsigned int pointer; | |||
13 | 13 | ||
14 | static void push(double a) | 14 | static void push(double a) |
15 | { | 15 | { |
16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) { | 16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) |
17 | errorMsg("stack overflow\n"); | 17 | fatalError("stack overflow\n"); |
18 | exit(-1); | 18 | stack[pointer++] = a; |
19 | } else | ||
20 | stack[pointer++] = a; | ||
21 | } | 19 | } |
22 | 20 | ||
23 | static double pop() | 21 | static double pop() |
24 | { | 22 | { |
25 | if (pointer == 0) { | 23 | if (pointer == 0) |
26 | errorMsg("stack underflow\n"); | 24 | fatalError("stack underflow\n"); |
27 | exit(-1); | ||
28 | } | ||
29 | return stack[--pointer]; | 25 | return stack[--pointer]; |
30 | } | 26 | } |
31 | 27 | ||
@@ -124,8 +120,7 @@ static void stack_machine(const char *argument) | |||
124 | } | 120 | } |
125 | o++; | 121 | o++; |
126 | } | 122 | } |
127 | errorMsg("%s: syntax error.\n", argument); | 123 | fatalError("%s: syntax error.\n", argument); |
128 | exit(-1); | ||
129 | } | 124 | } |
130 | 125 | ||
131 | /* return pointer to next token in buffer and set *buffer to one char | 126 | /* return pointer to next token in buffer and set *buffer to one char |
@@ -182,5 +177,5 @@ int dc_main(int argc, char **argv) | |||
182 | } | 177 | } |
183 | } | 178 | } |
184 | stack_machine(0); | 179 | stack_machine(0); |
185 | return( TRUE); | 180 | return EXIT_SUCCESS; |
186 | } | 181 | } |
@@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv) | |||
174 | (inTotal % blockSize) != 0); | 174 | (inTotal % blockSize) != 0); |
175 | printf("%ld+%d records out\n", (long) (outTotal / blockSize), | 175 | printf("%ld+%d records out\n", (long) (outTotal / blockSize), |
176 | (outTotal % blockSize) != 0); | 176 | (outTotal % blockSize) != 0); |
177 | exit(TRUE); | 177 | return EXIT_SUCCESS; |
178 | usage: | 178 | usage: |
179 | 179 | ||
180 | usage(dd_usage); | 180 | usage(dd_usage); |
diff --git a/deallocvt.c b/deallocvt.c index 65af79b77..4600c0d05 100644 --- a/deallocvt.c +++ b/deallocvt.c | |||
@@ -28,7 +28,7 @@ printf("erik: A\n"); | |||
28 | /* deallocate all unused consoles */ | 28 | /* deallocate all unused consoles */ |
29 | if (ioctl(fd, VT_DISALLOCATE, 0)) { | 29 | if (ioctl(fd, VT_DISALLOCATE, 0)) { |
30 | perror("VT_DISALLOCATE"); | 30 | perror("VT_DISALLOCATE"); |
31 | exit( FALSE); | 31 | return EXIT_FAILURE; |
32 | } | 32 | } |
33 | } else | 33 | } else |
34 | printf("erik: B\n"); | 34 | printf("erik: B\n"); |
@@ -44,5 +44,5 @@ printf("erik: B\n"); | |||
44 | } | 44 | } |
45 | } | 45 | } |
46 | printf("erik: C\n"); | 46 | printf("erik: C\n"); |
47 | return( TRUE); | 47 | return EXIT_SUCCESS; |
48 | } | 48 | } |
@@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv) | |||
79 | exit(FALSE); | 79 | exit(FALSE); |
80 | } | 80 | } |
81 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); | 81 | status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); |
82 | if (status != 0) | 82 | if (status != TRUE) |
83 | exit(status); | 83 | return EXIT_FAILURE; |
84 | argc--; | 84 | argc--; |
85 | argv++; | 85 | argv++; |
86 | } | 86 | } |
87 | exit(TRUE); | 87 | return EXIT_SUCCESS; |
88 | } else { | 88 | } else { |
89 | FILE *mountTable; | 89 | FILE *mountTable; |
90 | struct mntent *mountEntry; | 90 | struct mntent *mountEntry; |
@@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv) | |||
92 | mountTable = setmntent(mtab_file, "r"); | 92 | mountTable = setmntent(mtab_file, "r"); |
93 | if (mountTable == 0) { | 93 | if (mountTable == 0) { |
94 | perror(mtab_file); | 94 | perror(mtab_file); |
95 | exit(FALSE); | 95 | return EXIT_FAILURE; |
96 | } | 96 | } |
97 | 97 | ||
98 | while ((mountEntry = getmntent(mountTable))) { | 98 | while ((mountEntry = getmntent(mountTable))) { |
@@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv) | |||
101 | endmntent(mountTable); | 101 | endmntent(mountTable); |
102 | } | 102 | } |
103 | 103 | ||
104 | return(TRUE); | 104 | return EXIT_FAILURE; |
105 | } | 105 | } |
106 | 106 | ||
107 | /* | 107 | /* |
@@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv) | |||
40 | if (s && *s) | 40 | if (s && *s) |
41 | *s = '\0'; | 41 | *s = '\0'; |
42 | printf("%s\n", (s)? *argv : "."); | 42 | printf("%s\n", (s)? *argv : "."); |
43 | return(TRUE); | 43 | return EXIT_SUCCESS; |
44 | } | 44 | } |
@@ -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/dos2unix.c b/dos2unix.c index c9f783f1a..ed2088e4e 100644 --- a/dos2unix.c +++ b/dos2unix.c | |||
@@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) { | |||
41 | putchar(c); | 41 | putchar(c); |
42 | c = getchar(); | 42 | c = getchar(); |
43 | } | 43 | } |
44 | return 0; | 44 | return EXIT_SUCCESS; |
45 | } | 45 | } |
@@ -160,10 +160,10 @@ int du_main(int argc, char **argv) | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | return(0); | 163 | return EXIT_SUCCESS; |
164 | } | 164 | } |
165 | 165 | ||
166 | /* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */ | 166 | /* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */ |
167 | /* | 167 | /* |
168 | Local Variables: | 168 | Local Variables: |
169 | c-file-style: "linux" | 169 | c-file-style: "linux" |
diff --git a/dumpkmap.c b/dumpkmap.c index 2d989dfc4..77689fc84 100644 --- a/dumpkmap.c +++ b/dumpkmap.c | |||
@@ -51,7 +51,7 @@ int dumpkmap_main(int argc, char **argv) | |||
51 | fd = open("/dev/tty0", O_RDWR); | 51 | fd = open("/dev/tty0", O_RDWR); |
52 | if (fd < 0) { | 52 | if (fd < 0) { |
53 | errorMsg("Error opening /dev/tty0: %s\n", strerror(errno)); | 53 | errorMsg("Error opening /dev/tty0: %s\n", strerror(errno)); |
54 | return 1; | 54 | return EXIT_FAILURE; |
55 | } | 55 | } |
56 | 56 | ||
57 | write(1, magic, 7); | 57 | write(1, magic, 7); |
@@ -88,5 +88,5 @@ int dumpkmap_main(int argc, char **argv) | |||
88 | } | 88 | } |
89 | } | 89 | } |
90 | close(fd); | 90 | close(fd); |
91 | return 0; | 91 | return EXIT_SUCCESS; |
92 | } | 92 | } |
@@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv) | |||
62 | ut.ut_addr); | 62 | ut.ut_addr); |
63 | } | 63 | } |
64 | #endif | 64 | #endif |
65 | return(TRUE); | 65 | return EXIT_SUCCESS; |
66 | } | 66 | } |
@@ -107,7 +107,7 @@ just_echo: | |||
107 | putchar('\n'); | 107 | putchar('\n'); |
108 | fflush(stdout); | 108 | fflush(stdout); |
109 | 109 | ||
110 | return 0; | 110 | return EXIT_SUCCESS; |
111 | } | 111 | } |
112 | 112 | ||
113 | /*- | 113 | /*- |
@@ -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 | } |
@@ -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 | } |
@@ -100,8 +100,8 @@ int find_main(int argc, char **argv) | |||
100 | 100 | ||
101 | if (recursiveAction(directory, TRUE, FALSE, FALSE, | 101 | if (recursiveAction(directory, TRUE, FALSE, FALSE, |
102 | fileAction, fileAction, NULL) == FALSE) { | 102 | fileAction, fileAction, NULL) == FALSE) { |
103 | exit(FALSE); | 103 | return EXIT_FAILURE; |
104 | } | 104 | } |
105 | 105 | ||
106 | return(TRUE); | 106 | return EXIT_SUCCESS; |
107 | } | 107 | } |
diff --git a/findutils/find.c b/findutils/find.c index 48faf2c30..a86b07e73 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -100,8 +100,8 @@ int find_main(int argc, char **argv) | |||
100 | 100 | ||
101 | if (recursiveAction(directory, TRUE, FALSE, FALSE, | 101 | if (recursiveAction(directory, TRUE, FALSE, FALSE, |
102 | fileAction, fileAction, NULL) == FALSE) { | 102 | fileAction, fileAction, NULL) == FALSE) { |
103 | exit(FALSE); | 103 | return EXIT_FAILURE; |
104 | } | 104 | } |
105 | 105 | ||
106 | return(TRUE); | 106 | return EXIT_SUCCESS; |
107 | } | 107 | } |
@@ -60,7 +60,7 @@ extern int free_main(int argc, char **argv) | |||
60 | printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap, | 60 | printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap, |
61 | (info.totalram-info.freeram)+(info.totalswap-info.freeswap), | 61 | (info.totalram-info.freeram)+(info.totalswap-info.freeswap), |
62 | info.freeram+info.freeswap); | 62 | info.freeram+info.freeswap); |
63 | return(TRUE); | 63 | return EXIT_SUCCESS; |
64 | } | 64 | } |
65 | 65 | ||
66 | 66 | ||
diff --git a/freeramdisk.c b/freeramdisk.c index 22fc3e643..567151455 100644 --- a/freeramdisk.c +++ b/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 | /* |
@@ -1350,7 +1350,7 @@ int gunzip_main(int argc, char **argv) | |||
1350 | 1350 | ||
1351 | if (delInputFile == 1 && unlink(delFileName) < 0) { | 1351 | if (delInputFile == 1 && unlink(delFileName) < 0) { |
1352 | perror(delFileName); | 1352 | perror(delFileName); |
1353 | exit(FALSE); | 1353 | return EXIT_FAILURE; |
1354 | } | 1354 | } |
1355 | } | 1355 | } |
1356 | return(exit_code); | 1356 | return(exit_code); |
@@ -1930,7 +1930,7 @@ int gzip_main(int argc, char **argv) | |||
1930 | 1930 | ||
1931 | if (unlink(delFileName) < 0) { | 1931 | if (unlink(delFileName) < 0) { |
1932 | perror(delFileName); | 1932 | perror(delFileName); |
1933 | exit(FALSE); | 1933 | exit(EXIT_FAILURE); |
1934 | } | 1934 | } |
1935 | } | 1935 | } |
1936 | 1936 | ||
@@ -26,5 +26,5 @@ | |||
26 | extern int hostid_main(int argc, char **argv) | 26 | extern int hostid_main(int argc, char **argv) |
27 | { | 27 | { |
28 | printf("%lx\n", gethostid()); | 28 | printf("%lx\n", gethostid()); |
29 | return(TRUE); | 29 | return EXIT_SUCCESS; |
30 | } | 30 | } |
@@ -77,7 +77,7 @@ | |||
77 | #ifndef MODUTILS_MODULE_H | 77 | #ifndef MODUTILS_MODULE_H |
78 | #define MODUTILS_MODULE_H 1 | 78 | #define MODUTILS_MODULE_H 1 |
79 | 79 | ||
80 | #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $" | 80 | #ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $" |
81 | 81 | ||
82 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 82 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
83 | We do not use the kernel headers directly because we do not wish | 83 | We do not use the kernel headers directly because we do not wish |
@@ -283,7 +283,7 @@ int delete_module(const char *); | |||
283 | #ifndef MODUTILS_OBJ_H | 283 | #ifndef MODUTILS_OBJ_H |
284 | #define MODUTILS_OBJ_H 1 | 284 | #define MODUTILS_OBJ_H 1 |
285 | 285 | ||
286 | #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $" | 286 | #ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $" |
287 | 287 | ||
288 | /* The relocatable object is manipulated using elfin types. */ | 288 | /* The relocatable object is manipulated using elfin types. */ |
289 | 289 | ||
@@ -2769,7 +2769,7 @@ extern int insmod_main( int argc, char **argv) | |||
2769 | FILE *fp; | 2769 | FILE *fp; |
2770 | struct obj_file *f; | 2770 | struct obj_file *f; |
2771 | char m_name[BUFSIZ + 1] = "\0"; | 2771 | char m_name[BUFSIZ + 1] = "\0"; |
2772 | int exit_status = FALSE; | 2772 | int exit_status = EXIT_FAILURE; |
2773 | int m_has_modinfo; | 2773 | int m_has_modinfo; |
2774 | #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING | 2774 | #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING |
2775 | int k_version; | 2775 | int k_version; |
@@ -2833,7 +2833,7 @@ extern int insmod_main( int argc, char **argv) | |||
2833 | || ((fp = fopen(m_filename, "r")) == NULL)) | 2833 | || ((fp = fopen(m_filename, "r")) == NULL)) |
2834 | { | 2834 | { |
2835 | errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2835 | errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); |
2836 | exit(FALSE); | 2836 | return EXIT_FAILURE; |
2837 | } | 2837 | } |
2838 | } else | 2838 | } else |
2839 | fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2839 | fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); |
@@ -2843,7 +2843,7 @@ extern int insmod_main( int argc, char **argv) | |||
2843 | 2843 | ||
2844 | if ((f = obj_load(fp)) == NULL) { | 2844 | if ((f = obj_load(fp)) == NULL) { |
2845 | perror("Could not load the module\n"); | 2845 | perror("Could not load the module\n"); |
2846 | exit(FALSE); | 2846 | return EXIT_FAILURE; |
2847 | } | 2847 | } |
2848 | 2848 | ||
2849 | if (get_modinfo_value(f, "kernel_version") == NULL) | 2849 | if (get_modinfo_value(f, "kernel_version") == NULL) |
@@ -2981,7 +2981,7 @@ extern int insmod_main( int argc, char **argv) | |||
2981 | goto out; | 2981 | goto out; |
2982 | } | 2982 | } |
2983 | 2983 | ||
2984 | exit_status = TRUE; | 2984 | exit_status = EXIT_SUCCESS; |
2985 | 2985 | ||
2986 | out: | 2986 | out: |
2987 | fclose(fp); | 2987 | fclose(fp); |
@@ -158,7 +158,7 @@ extern int kill_main(int argc, char **argv) | |||
158 | } | 158 | } |
159 | } | 159 | } |
160 | fprintf(stderr, "\n\n"); | 160 | fprintf(stderr, "\n\n"); |
161 | exit(TRUE); | 161 | return EXIT_SUCCESS; |
162 | } | 162 | } |
163 | break; | 163 | break; |
164 | case '-': | 164 | case '-': |
@@ -236,11 +236,12 @@ extern int kill_main(int argc, char **argv) | |||
236 | * upon exit, so we can save a byte or two */ | 236 | * upon exit, so we can save a byte or two */ |
237 | argv++; | 237 | argv++; |
238 | } | 238 | } |
239 | exit (all_found); | 239 | if (all_found == FALSE) |
240 | return EXIT_FAILURE; | ||
240 | } | 241 | } |
241 | #endif | 242 | #endif |
242 | 243 | ||
243 | exit(TRUE); | 244 | return EXIT_SUCCESS; |
244 | 245 | ||
245 | 246 | ||
246 | end: | 247 | end: |
@@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk) | |||
217 | newdir = cmd->progs[0].argv[1]; | 217 | newdir = cmd->progs[0].argv[1]; |
218 | if (chdir(newdir)) { | 218 | if (chdir(newdir)) { |
219 | printf("cd: %s: %s\n", newdir, strerror(errno)); | 219 | printf("cd: %s: %s\n", newdir, strerror(errno)); |
220 | return FALSE; | 220 | return EXIT_FAILURE; |
221 | } | 221 | } |
222 | getcwd(cwd, sizeof(char)*MAX_LINE); | 222 | getcwd(cwd, sizeof(char)*MAX_LINE); |
223 | 223 | ||
224 | return TRUE; | 224 | return EXIT_SUCCESS; |
225 | } | 225 | } |
226 | 226 | ||
227 | /* built-in 'env' handler */ | 227 | /* built-in 'env' handler */ |
@@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk) | |||
245 | fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0], | 245 | fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0], |
246 | strerror(errno)); | 246 | strerror(errno)); |
247 | } | 247 | } |
248 | return TRUE; | 248 | return EXIT_SUCCESS; |
249 | } | 249 | } |
250 | 250 | ||
251 | /* built-in 'exit' handler */ | 251 | /* built-in 'exit' handler */ |
252 | static int builtin_exit(struct job *cmd, struct jobSet *junk) | 252 | static int builtin_exit(struct job *cmd, struct jobSet *junk) |
253 | { | 253 | { |
254 | if (!cmd->progs[0].argv[1] == 1) | 254 | if (!cmd->progs[0].argv[1] == 1) |
255 | exit TRUE; | 255 | exit(EXIT_SUCCESS); |
256 | 256 | ||
257 | exit (atoi(cmd->progs[0].argv[1])); | 257 | exit (atoi(cmd->progs[0].argv[1])); |
258 | } | 258 | } |
@@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
267 | if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { | 267 | if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { |
268 | errorMsg("%s: exactly one argument is expected\n", | 268 | errorMsg("%s: exactly one argument is expected\n", |
269 | cmd->progs[0].argv[0]); | 269 | cmd->progs[0].argv[0]); |
270 | return FALSE; | 270 | return EXIT_FAILURE; |
271 | } | 271 | } |
272 | if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) { | 272 | if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) { |
273 | errorMsg("%s: bad argument '%s'\n", | 273 | errorMsg("%s: bad argument '%s'\n", |
274 | cmd->progs[0].argv[0], cmd->progs[0].argv[1]); | 274 | cmd->progs[0].argv[0], cmd->progs[0].argv[1]); |
275 | return FALSE; | 275 | return EXIT_FAILURE; |
276 | for (job = jobList->head; job; job = job->next) { | 276 | for (job = jobList->head; job; job = job->next) { |
277 | if (job->jobId == jobNum) { | 277 | if (job->jobId == jobNum) { |
278 | break; | 278 | break; |
@@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
286 | if (!job) { | 286 | if (!job) { |
287 | errorMsg("%s: unknown job %d\n", | 287 | errorMsg("%s: unknown job %d\n", |
288 | cmd->progs[0].argv[0], jobNum); | 288 | cmd->progs[0].argv[0], jobNum); |
289 | return FALSE; | 289 | return EXIT_FAILURE; |
290 | } | 290 | } |
291 | 291 | ||
292 | if (*cmd->progs[0].argv[0] == 'f') { | 292 | if (*cmd->progs[0].argv[0] == 'f') { |
@@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
305 | 305 | ||
306 | job->stoppedProgs = 0; | 306 | job->stoppedProgs = 0; |
307 | 307 | ||
308 | return TRUE; | 308 | return EXIT_SUCCESS; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* built-in 'help' handler */ | 311 | /* built-in 'help' handler */ |
@@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk) | |||
326 | fprintf(stdout, "%s\t%s\n", x->cmd, x->descr); | 326 | fprintf(stdout, "%s\t%s\n", x->cmd, x->descr); |
327 | } | 327 | } |
328 | fprintf(stdout, "\n\n"); | 328 | fprintf(stdout, "\n\n"); |
329 | return TRUE; | 329 | return EXIT_SUCCESS; |
330 | } | 330 | } |
331 | 331 | ||
332 | /* built-in 'jobs' handler */ | 332 | /* built-in 'jobs' handler */ |
@@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList) | |||
343 | 343 | ||
344 | printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text); | 344 | printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text); |
345 | } | 345 | } |
346 | return TRUE; | 346 | return EXIT_SUCCESS; |
347 | } | 347 | } |
348 | 348 | ||
349 | 349 | ||
@@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk) | |||
352 | { | 352 | { |
353 | getcwd(cwd, sizeof(char)*MAX_LINE); | 353 | getcwd(cwd, sizeof(char)*MAX_LINE); |
354 | fprintf(stdout, "%s\n", cwd); | 354 | fprintf(stdout, "%s\n", cwd); |
355 | return TRUE; | 355 | return EXIT_SUCCESS; |
356 | } | 356 | } |
357 | 357 | ||
358 | /* built-in 'export VAR=value' handler */ | 358 | /* built-in 'export VAR=value' handler */ |
@@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk) | |||
437 | 437 | ||
438 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 438 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
439 | errorMsg("unexpected token `then'\n"); | 439 | errorMsg("unexpected token `then'\n"); |
440 | return FALSE; | 440 | return EXIT_FAILURE; |
441 | } | 441 | } |
442 | /* If the if result was FALSE, skip the 'then' stuff */ | 442 | /* If the if result was FALSE, skip the 'then' stuff */ |
443 | if (cmd->jobContext & IF_FALSE_CONTEXT) { | 443 | if (cmd->jobContext & IF_FALSE_CONTEXT) { |
444 | return TRUE; | 444 | return EXIT_SUCCESS; |
445 | } | 445 | } |
446 | 446 | ||
447 | cmd->jobContext |= THEN_EXP_CONTEXT; | 447 | cmd->jobContext |= THEN_EXP_CONTEXT; |
@@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk) | |||
464 | 464 | ||
465 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 465 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
466 | errorMsg("unexpected token `else'\n"); | 466 | errorMsg("unexpected token `else'\n"); |
467 | return FALSE; | 467 | return EXIT_FAILURE; |
468 | } | 468 | } |
469 | /* If the if result was TRUE, skip the 'else' stuff */ | 469 | /* If the if result was TRUE, skip the 'else' stuff */ |
470 | if (cmd->jobContext & IF_TRUE_CONTEXT) { | 470 | if (cmd->jobContext & IF_TRUE_CONTEXT) { |
471 | return TRUE; | 471 | return EXIT_SUCCESS; |
472 | } | 472 | } |
473 | 473 | ||
474 | cmd->jobContext |= ELSE_EXP_CONTEXT; | 474 | cmd->jobContext |= ELSE_EXP_CONTEXT; |
@@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk) | |||
488 | { | 488 | { |
489 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 489 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
490 | errorMsg("unexpected token `fi'\n"); | 490 | errorMsg("unexpected token `fi'\n"); |
491 | return FALSE; | 491 | return EXIT_FAILURE; |
492 | } | 492 | } |
493 | /* Clear out the if and then context bits */ | 493 | /* Clear out the if and then context bits */ |
494 | cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT); | 494 | cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT); |
495 | debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext); | 495 | debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext); |
496 | return TRUE; | 496 | return EXIT_SUCCESS; |
497 | } | 497 | } |
498 | #endif | 498 | #endif |
499 | 499 | ||
@@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk) | |||
504 | int status; | 504 | int status; |
505 | 505 | ||
506 | if (!cmd->progs[0].argv[1] == 1) | 506 | if (!cmd->progs[0].argv[1] == 1) |
507 | return FALSE; | 507 | return EXIT_FAILURE; |
508 | 508 | ||
509 | input = fopen(cmd->progs[0].argv[1], "r"); | 509 | input = fopen(cmd->progs[0].argv[1], "r"); |
510 | if (!input) { | 510 | if (!input) { |
511 | fprintf(stdout, "Couldn't open file '%s'\n", | 511 | fprintf(stdout, "Couldn't open file '%s'\n", |
512 | cmd->progs[0].argv[1]); | 512 | cmd->progs[0].argv[1]); |
513 | return FALSE; | 513 | return EXIT_FAILURE; |
514 | } | 514 | } |
515 | 515 | ||
516 | /* Now run the file */ | 516 | /* Now run the file */ |
@@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk) | |||
524 | { | 524 | { |
525 | if (!cmd->progs[0].argv[1] == 1) { | 525 | if (!cmd->progs[0].argv[1] == 1) { |
526 | fprintf(stdout, "unset: parameter required.\n"); | 526 | fprintf(stdout, "unset: parameter required.\n"); |
527 | return FALSE; | 527 | return EXIT_FAILURE; |
528 | } | 528 | } |
529 | unsetenv(cmd->progs[0].argv[1]); | 529 | unsetenv(cmd->progs[0].argv[1]); |
530 | return TRUE; | 530 | return EXIT_SUCCESS; |
531 | } | 531 | } |
532 | 532 | ||
533 | /* free up all memory from a job */ | 533 | /* free up all memory from a job */ |
@@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv) | |||
9 | if (argc != 2 || **(argv + 1) == '-') | 9 | if (argc != 2 || **(argv + 1) == '-') |
10 | usage(length_usage); | 10 | usage(length_usage); |
11 | printf("%lu\n", (long)strlen(argv[1])); | 11 | printf("%lu\n", (long)strlen(argv[1])); |
12 | return (TRUE); | 12 | return EXIT_SUCCESS; |
13 | } | 13 | } |
@@ -40,17 +40,17 @@ int loadacm_main(int argc, char **argv) | |||
40 | fd = open("/dev/tty", O_RDWR); | 40 | fd = open("/dev/tty", O_RDWR); |
41 | if (fd < 0) { | 41 | if (fd < 0) { |
42 | errorMsg("Error opening /dev/tty1: %s\n", strerror(errno)); | 42 | errorMsg("Error opening /dev/tty1: %s\n", strerror(errno)); |
43 | return( FALSE); | 43 | return EXIT_FAILURE; |
44 | } | 44 | } |
45 | 45 | ||
46 | if (screen_map_load(fd, stdin)) { | 46 | if (screen_map_load(fd, stdin)) { |
47 | errorMsg("Error loading acm: %s\n", strerror(errno)); | 47 | errorMsg("Error loading acm: %s\n", strerror(errno)); |
48 | return( FALSE); | 48 | return EXIT_FAILURE; |
49 | } | 49 | } |
50 | 50 | ||
51 | write(fd, "\033(K", 3); | 51 | write(fd, "\033(K", 3); |
52 | 52 | ||
53 | return( TRUE); | 53 | return EXIT_SUCCESS; |
54 | } | 54 | } |
55 | 55 | ||
56 | int screen_map_load(int fd, FILE * fp) | 56 | int screen_map_load(int fd, FILE * fp) |
@@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv) | |||
878 | 878 | ||
879 | print_usage_message: | 879 | print_usage_message: |
880 | usage(ls_usage); | 880 | usage(ls_usage); |
881 | return(FALSE); | ||
882 | } | 881 | } |
@@ -902,22 +902,22 @@ int md5sum_main(int argc, | |||
902 | 902 | ||
903 | if (file_type_specified && do_check) { | 903 | if (file_type_specified && do_check) { |
904 | errorMsg("the -b and -t options are meaningless when verifying checksums\n"); | 904 | errorMsg("the -b and -t options are meaningless when verifying checksums\n"); |
905 | exit FALSE; | 905 | return EXIT_FAILURE; |
906 | } | 906 | } |
907 | 907 | ||
908 | if (n_strings > 0 && do_check) { | 908 | if (n_strings > 0 && do_check) { |
909 | errorMsg("the -g and -c options are mutually exclusive\n"); | 909 | errorMsg("the -g and -c options are mutually exclusive\n"); |
910 | exit FALSE; | 910 | return EXIT_FAILURE; |
911 | } | 911 | } |
912 | 912 | ||
913 | if (status_only && !do_check) { | 913 | if (status_only && !do_check) { |
914 | errorMsg("the -s option is meaningful only when verifying checksums\n"); | 914 | errorMsg("the -s option is meaningful only when verifying checksums\n"); |
915 | exit FALSE; | 915 | return EXIT_FAILURE; |
916 | } | 916 | } |
917 | 917 | ||
918 | if (warn && !do_check) { | 918 | if (warn && !do_check) { |
919 | errorMsg("the -w option is meaningful only when verifying checksums\n"); | 919 | errorMsg("the -w option is meaningful only when verifying checksums\n"); |
920 | exit FALSE; | 920 | return EXIT_FAILURE; |
921 | } | 921 | } |
922 | 922 | ||
923 | if (n_strings > 0) { | 923 | if (n_strings > 0) { |
@@ -925,7 +925,7 @@ int md5sum_main(int argc, | |||
925 | 925 | ||
926 | if (optind < argc) { | 926 | if (optind < argc) { |
927 | errorMsg("no files may be specified when using -g\n"); | 927 | errorMsg("no files may be specified when using -g\n"); |
928 | exit FALSE; | 928 | return EXIT_FAILURE; |
929 | } | 929 | } |
930 | for (i = 0; i < n_strings; ++i) { | 930 | for (i = 0; i < n_strings; ++i) { |
931 | size_t cnt; | 931 | size_t cnt; |
@@ -992,13 +992,16 @@ int md5sum_main(int argc, | |||
992 | 992 | ||
993 | if (fclose (stdout) == EOF) { | 993 | if (fclose (stdout) == EOF) { |
994 | errorMsg("write error\n"); | 994 | errorMsg("write error\n"); |
995 | exit FALSE; | 995 | return EXIT_FAILURE; |
996 | } | 996 | } |
997 | 997 | ||
998 | if (have_read_stdin && fclose (stdin) == EOF) { | 998 | if (have_read_stdin && fclose (stdin) == EOF) { |
999 | errorMsg("standard input\n"); | 999 | errorMsg("standard input\n"); |
1000 | exit FALSE; | 1000 | return EXIT_FAILURE; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | exit (err == 0 ? TRUE : FALSE); | 1003 | if (err == 0) |
1004 | return EXIT_SUCCESS; | ||
1005 | else | ||
1006 | return EXIT_FAILURE; | ||
1004 | } | 1007 | } |
diff --git a/miscutils/dc.c b/miscutils/dc.c index 48aa830d6..0f5f1fc77 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c | |||
@@ -13,19 +13,15 @@ static unsigned int pointer; | |||
13 | 13 | ||
14 | static void push(double a) | 14 | static void push(double a) |
15 | { | 15 | { |
16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) { | 16 | if (pointer >= (sizeof(stack) / sizeof(*stack))) |
17 | errorMsg("stack overflow\n"); | 17 | fatalError("stack overflow\n"); |
18 | exit(-1); | 18 | stack[pointer++] = a; |
19 | } else | ||
20 | stack[pointer++] = a; | ||
21 | } | 19 | } |
22 | 20 | ||
23 | static double pop() | 21 | static double pop() |
24 | { | 22 | { |
25 | if (pointer == 0) { | 23 | if (pointer == 0) |
26 | errorMsg("stack underflow\n"); | 24 | fatalError("stack underflow\n"); |
27 | exit(-1); | ||
28 | } | ||
29 | return stack[--pointer]; | 25 | return stack[--pointer]; |
30 | } | 26 | } |
31 | 27 | ||
@@ -124,8 +120,7 @@ static void stack_machine(const char *argument) | |||
124 | } | 120 | } |
125 | o++; | 121 | o++; |
126 | } | 122 | } |
127 | errorMsg("%s: syntax error.\n", argument); | 123 | fatalError("%s: syntax error.\n", argument); |
128 | exit(-1); | ||
129 | } | 124 | } |
130 | 125 | ||
131 | /* return pointer to next token in buffer and set *buffer to one char | 126 | /* return pointer to next token in buffer and set *buffer to one char |
@@ -182,5 +177,5 @@ int dc_main(int argc, char **argv) | |||
182 | } | 177 | } |
183 | } | 178 | } |
184 | stack_machine(0); | 179 | stack_machine(0); |
185 | return( TRUE); | 180 | return EXIT_SUCCESS; |
186 | } | 181 | } |
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c index cf5f1cff8..03d80d87d 100644 --- a/miscutils/dutmp.c +++ b/miscutils/dutmp.c | |||
@@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv) | |||
62 | ut.ut_addr); | 62 | ut.ut_addr); |
63 | } | 63 | } |
64 | #endif | 64 | #endif |
65 | return(TRUE); | 65 | return EXIT_SUCCESS; |
66 | } | 66 | } |
diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c index 62ca870c5..2d53cc2a4 100644 --- a/miscutils/mktemp.c +++ b/miscutils/mktemp.c | |||
@@ -31,7 +31,7 @@ extern int mktemp_main(int argc, char **argv) | |||
31 | if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) | 31 | if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) |
32 | usage(mktemp_usage); | 32 | usage(mktemp_usage); |
33 | if(mkstemp(argv[argc-1]) < 0) | 33 | if(mkstemp(argv[argc-1]) < 0) |
34 | exit(FALSE); | 34 | return EXIT_FAILURE; |
35 | (void) puts(argv[argc-1]); | 35 | (void) puts(argv[argc-1]); |
36 | return(TRUE); | 36 | return EXIT_SUCCESS; |
37 | } | 37 | } |
diff --git a/miscutils/mt.c b/miscutils/mt.c index 6acae4ea1..583674b18 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c | |||
@@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv) | |||
76 | 76 | ||
77 | if (code->name == 0) { | 77 | if (code->name == 0) { |
78 | errorMsg("unrecognized opcode %s.\n", argv[1]); | 78 | errorMsg("unrecognized opcode %s.\n", argv[1]); |
79 | exit (FALSE); | 79 | return EXIT_FAILURE; |
80 | } | 80 | } |
81 | 81 | ||
82 | op.mt_op = code->value; | 82 | op.mt_op = code->value; |
@@ -87,13 +87,13 @@ extern int mt_main(int argc, char **argv) | |||
87 | 87 | ||
88 | if ((fd = open(file, O_RDONLY, 0)) < 0) { | 88 | if ((fd = open(file, O_RDONLY, 0)) < 0) { |
89 | perror(file); | 89 | perror(file); |
90 | exit (FALSE); | 90 | return EXIT_FAILURE; |
91 | } | 91 | } |
92 | 92 | ||
93 | if (ioctl(fd, MTIOCTOP, &op) != 0) { | 93 | if (ioctl(fd, MTIOCTOP, &op) != 0) { |
94 | perror(file); | 94 | perror(file); |
95 | exit (FALSE); | 95 | return EXIT_FAILURE; |
96 | } | 96 | } |
97 | 97 | ||
98 | return (TRUE); | 98 | return EXIT_SUCCESS; |
99 | } | 99 | } |
diff --git a/miscutils/update.c b/miscutils/update.c index 7279d83a8..080cb99c3 100644 --- a/miscutils/update.c +++ b/miscutils/update.c | |||
@@ -67,7 +67,7 @@ extern int update_main(int argc, char **argv) | |||
67 | 67 | ||
68 | pid = fork(); | 68 | pid = fork(); |
69 | if (pid < 0) | 69 | if (pid < 0) |
70 | exit(FALSE); | 70 | return EXIT_FAILURE; |
71 | else if (pid == 0) { | 71 | else if (pid == 0) { |
72 | /* Become a proper daemon */ | 72 | /* Become a proper daemon */ |
73 | setsid(); | 73 | setsid(); |
@@ -99,12 +99,12 @@ extern int update_main(int argc, char **argv) | |||
99 | syslog(LOG_INFO, | 99 | syslog(LOG_INFO, |
100 | "This kernel does not need update(8). Exiting."); | 100 | "This kernel does not need update(8). Exiting."); |
101 | closelog(); | 101 | closelog(); |
102 | exit(TRUE); | 102 | return EXIT_SUCCESS; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
106 | } | 106 | } |
107 | return( TRUE); | 107 | return EXIT_SUCCESS; |
108 | } | 108 | } |
109 | 109 | ||
110 | /* | 110 | /* |
@@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv) | |||
51 | mode = 0; | 51 | mode = 0; |
52 | if (parse_mode(*(++argv), &mode) == FALSE) { | 52 | if (parse_mode(*(++argv), &mode) == FALSE) { |
53 | errorMsg("Unknown mode: %s\n", *argv); | 53 | errorMsg("Unknown mode: %s\n", *argv); |
54 | exit FALSE; | 54 | return EXIT_FAILURE; |
55 | } | 55 | } |
56 | /* Set the umask for this process so it doesn't | 56 | /* Set the umask for this process so it doesn't |
57 | * screw up whatever the user just entered. */ | 57 | * screw up whatever the user just entered. */ |
@@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv) | |||
80 | 80 | ||
81 | if (strlen(*argv) > BUFSIZ - 1) { | 81 | if (strlen(*argv) > BUFSIZ - 1) { |
82 | errorMsg(name_too_long); | 82 | errorMsg(name_too_long); |
83 | exit FALSE; | 83 | return EXIT_FAILURE; |
84 | } | 84 | } |
85 | strcpy(buf, *argv); | 85 | strcpy(buf, *argv); |
86 | status = stat(buf, &statBuf); | 86 | status = stat(buf, &statBuf); |
87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { | 87 | if (parentFlag == FALSE && status != -1 && errno != ENOENT) { |
88 | errorMsg("%s: File exists\n", buf); | 88 | errorMsg("%s: File exists\n", buf); |
89 | exit FALSE; | 89 | return EXIT_FAILURE; |
90 | } | 90 | } |
91 | if (parentFlag == TRUE) { | 91 | if (parentFlag == TRUE) { |
92 | strcat(buf, "/"); | 92 | strcat(buf, "/"); |
@@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv) | |||
94 | } else { | 94 | } else { |
95 | if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { | 95 | if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { |
96 | perror(buf); | 96 | perror(buf); |
97 | exit FALSE; | 97 | return EXIT_FAILURE; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | argc--; | 100 | argc--; |
101 | argv++; | 101 | argv++; |
102 | } | 102 | } |
103 | return( TRUE); | 103 | return EXIT_SUCCESS; |
104 | } | 104 | } |
@@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv) | |||
55 | usage(mkfifo_usage); | 55 | usage(mkfifo_usage); |
56 | if (mkfifo(*argv, mode) < 0) { | 56 | if (mkfifo(*argv, mode) < 0) { |
57 | perror("mkfifo"); | 57 | perror("mkfifo"); |
58 | exit(255); | 58 | return EXIT_FAILURE; |
59 | } | 59 | } |
60 | return(TRUE); | 60 | return EXIT_SUCCESS; |
61 | } | 61 | } |
@@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv) | |||
85 | 85 | ||
86 | if (mknod(argv[0], mode, dev) != 0) | 86 | if (mknod(argv[0], mode, dev) != 0) |
87 | fatalError("%s: %s\n", argv[0], strerror(errno)); | 87 | fatalError("%s: %s\n", argv[0], strerror(errno)); |
88 | return (TRUE); | 88 | return EXIT_SUCCESS; |
89 | } | 89 | } |
90 | 90 | ||
@@ -176,7 +176,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr) | |||
176 | void die(const char *str) | 176 | void 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 | ||
182 | void page_ok(int page) | 182 | void 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 | } |
@@ -31,7 +31,7 @@ extern int mktemp_main(int argc, char **argv) | |||
31 | if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) | 31 | if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q"))) |
32 | usage(mktemp_usage); | 32 | usage(mktemp_usage); |
33 | if(mkstemp(argv[argc-1]) < 0) | 33 | if(mkstemp(argv[argc-1]) < 0) |
34 | exit(FALSE); | 34 | return EXIT_FAILURE; |
35 | (void) puts(argv[argc-1]); | 35 | (void) puts(argv[argc-1]); |
36 | return(TRUE); | 36 | return EXIT_SUCCESS; |
37 | } | 37 | } |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 4f96c950e..6386b9407 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -77,7 +77,7 @@ | |||
77 | #ifndef MODUTILS_MODULE_H | 77 | #ifndef MODUTILS_MODULE_H |
78 | #define MODUTILS_MODULE_H 1 | 78 | #define MODUTILS_MODULE_H 1 |
79 | 79 | ||
80 | #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $" | 80 | #ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $" |
81 | 81 | ||
82 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 82 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
83 | We do not use the kernel headers directly because we do not wish | 83 | We do not use the kernel headers directly because we do not wish |
@@ -283,7 +283,7 @@ int delete_module(const char *); | |||
283 | #ifndef MODUTILS_OBJ_H | 283 | #ifndef MODUTILS_OBJ_H |
284 | #define MODUTILS_OBJ_H 1 | 284 | #define MODUTILS_OBJ_H 1 |
285 | 285 | ||
286 | #ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $" | 286 | #ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $" |
287 | 287 | ||
288 | /* The relocatable object is manipulated using elfin types. */ | 288 | /* The relocatable object is manipulated using elfin types. */ |
289 | 289 | ||
@@ -2769,7 +2769,7 @@ extern int insmod_main( int argc, char **argv) | |||
2769 | FILE *fp; | 2769 | FILE *fp; |
2770 | struct obj_file *f; | 2770 | struct obj_file *f; |
2771 | char m_name[BUFSIZ + 1] = "\0"; | 2771 | char m_name[BUFSIZ + 1] = "\0"; |
2772 | int exit_status = FALSE; | 2772 | int exit_status = EXIT_FAILURE; |
2773 | int m_has_modinfo; | 2773 | int m_has_modinfo; |
2774 | #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING | 2774 | #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING |
2775 | int k_version; | 2775 | int k_version; |
@@ -2833,7 +2833,7 @@ extern int insmod_main( int argc, char **argv) | |||
2833 | || ((fp = fopen(m_filename, "r")) == NULL)) | 2833 | || ((fp = fopen(m_filename, "r")) == NULL)) |
2834 | { | 2834 | { |
2835 | errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2835 | errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); |
2836 | exit(FALSE); | 2836 | return EXIT_FAILURE; |
2837 | } | 2837 | } |
2838 | } else | 2838 | } else |
2839 | fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); | 2839 | fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES); |
@@ -2843,7 +2843,7 @@ extern int insmod_main( int argc, char **argv) | |||
2843 | 2843 | ||
2844 | if ((f = obj_load(fp)) == NULL) { | 2844 | if ((f = obj_load(fp)) == NULL) { |
2845 | perror("Could not load the module\n"); | 2845 | perror("Could not load the module\n"); |
2846 | exit(FALSE); | 2846 | return EXIT_FAILURE; |
2847 | } | 2847 | } |
2848 | 2848 | ||
2849 | if (get_modinfo_value(f, "kernel_version") == NULL) | 2849 | if (get_modinfo_value(f, "kernel_version") == NULL) |
@@ -2981,7 +2981,7 @@ extern int insmod_main( int argc, char **argv) | |||
2981 | goto out; | 2981 | goto out; |
2982 | } | 2982 | } |
2983 | 2983 | ||
2984 | exit_status = TRUE; | 2984 | exit_status = EXIT_SUCCESS; |
2985 | 2985 | ||
2986 | out: | 2986 | out: |
2987 | fclose(fp); | 2987 | fclose(fp); |
diff --git a/modutils/rmmod.c b/modutils/rmmod.c index dd293523d..f5d7d359a 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c | |||
@@ -34,7 +34,7 @@ _syscall1(int, delete_module, const char *, name) | |||
34 | 34 | ||
35 | extern int rmmod_main(int argc, char **argv) | 35 | extern int rmmod_main(int argc, char **argv) |
36 | { | 36 | { |
37 | int ret = TRUE; | 37 | int ret = EXIT_SUCCESS; |
38 | if (argc <= 1) { | 38 | if (argc <= 1) { |
39 | usage(rmmod_usage); | 39 | usage(rmmod_usage); |
40 | } | 40 | } |
@@ -47,9 +47,9 @@ extern int rmmod_main(int argc, char **argv) | |||
47 | /* Unload _all_ unused modules via NULL delete_module() call */ | 47 | /* Unload _all_ unused modules via NULL delete_module() call */ |
48 | if (delete_module(NULL)) { | 48 | if (delete_module(NULL)) { |
49 | perror("rmmod"); | 49 | perror("rmmod"); |
50 | exit(FALSE); | 50 | return EXIT_FAILURE; |
51 | } | 51 | } |
52 | exit(TRUE); | 52 | return EXIT_SUCCESS; |
53 | default: | 53 | default: |
54 | usage(rmmod_usage); | 54 | usage(rmmod_usage); |
55 | } | 55 | } |
@@ -59,7 +59,7 @@ extern int rmmod_main(int argc, char **argv) | |||
59 | while (argc-- > 0) { | 59 | while (argc-- > 0) { |
60 | if (delete_module(*argv) < 0) { | 60 | if (delete_module(*argv) < 0) { |
61 | perror(*argv); | 61 | perror(*argv); |
62 | ret=FALSE; | 62 | ret = EXIT_FAILURE; |
63 | } | 63 | } |
64 | argv++; | 64 | argv++; |
65 | } | 65 | } |
@@ -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 | |||
517 | goodbye: | 515 | goodbye: |
518 | usage(mount_usage); | 516 | usage(mount_usage); |
519 | } | 517 | } |
@@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv) | |||
76 | 76 | ||
77 | if (code->name == 0) { | 77 | if (code->name == 0) { |
78 | errorMsg("unrecognized opcode %s.\n", argv[1]); | 78 | errorMsg("unrecognized opcode %s.\n", argv[1]); |
79 | exit (FALSE); | 79 | return EXIT_FAILURE; |
80 | } | 80 | } |
81 | 81 | ||
82 | op.mt_op = code->value; | 82 | op.mt_op = code->value; |
@@ -87,13 +87,13 @@ extern int mt_main(int argc, char **argv) | |||
87 | 87 | ||
88 | if ((fd = open(file, O_RDONLY, 0)) < 0) { | 88 | if ((fd = open(file, O_RDONLY, 0)) < 0) { |
89 | perror(file); | 89 | perror(file); |
90 | exit (FALSE); | 90 | return EXIT_FAILURE; |
91 | } | 91 | } |
92 | 92 | ||
93 | if (ioctl(fd, MTIOCTOP, &op) != 0) { | 93 | if (ioctl(fd, MTIOCTOP, &op) != 0) { |
94 | perror(file); | 94 | perror(file); |
95 | exit (FALSE); | 95 | return EXIT_FAILURE; |
96 | } | 96 | } |
97 | 97 | ||
98 | return (TRUE); | 98 | return EXIT_SUCCESS; |
99 | } | 99 | } |
diff --git a/networking/nslookup.c b/networking/nslookup.c index acb3e3bb2..c46a0b8ea 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -167,7 +167,7 @@ int nslookup_main(int argc, char **argv) | |||
167 | host = gethostbyname(argv[1]); | 167 | host = gethostbyname(argv[1]); |
168 | } | 168 | } |
169 | hostent_fprint(host, stdout); | 169 | hostent_fprint(host, stdout); |
170 | return( TRUE); | 170 | return EXIT_SUCCESS; |
171 | } | 171 | } |
172 | 172 | ||
173 | /* $Id: nslookup.c,v 1.12 2000/09/25 21:45:58 andersen Exp $ */ | 173 | /* $Id: nslookup.c,v 1.13 2000/12/01 02:55:13 kraai Exp $ */ |
diff --git a/networking/ping.c b/networking/ping.c index a4363098e..af109cf0a 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.26 2000/11/14 23:29:24 andersen Exp $ | 3 | * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -256,7 +256,7 @@ extern int ping_main(int argc, char **argv) | |||
256 | if (argc < 1) | 256 | if (argc < 1) |
257 | usage(ping_usage); | 257 | usage(ping_usage); |
258 | ping(*argv); | 258 | ping(*argv); |
259 | exit(TRUE); | 259 | return EXIT_SUCCESS; |
260 | } | 260 | } |
261 | 261 | ||
262 | #else /* ! BB_FEATURE_SIMPLE_PING */ | 262 | #else /* ! BB_FEATURE_SIMPLE_PING */ |
@@ -546,7 +546,7 @@ extern int ping_main(int argc, char **argv) | |||
546 | 546 | ||
547 | myid = getpid() & 0xFFFF; | 547 | myid = getpid() & 0xFFFF; |
548 | ping(*argv); | 548 | ping(*argv); |
549 | return(TRUE); | 549 | return EXIT_SUCCESS; |
550 | } | 550 | } |
551 | #endif /* ! BB_FEATURE_SIMPLE_PING */ | 551 | #endif /* ! BB_FEATURE_SIMPLE_PING */ |
552 | 552 | ||
diff --git a/nslookup.c b/nslookup.c index acb3e3bb2..c46a0b8ea 100644 --- a/nslookup.c +++ b/nslookup.c | |||
@@ -167,7 +167,7 @@ int nslookup_main(int argc, char **argv) | |||
167 | host = gethostbyname(argv[1]); | 167 | host = gethostbyname(argv[1]); |
168 | } | 168 | } |
169 | hostent_fprint(host, stdout); | 169 | hostent_fprint(host, stdout); |
170 | return( TRUE); | 170 | return EXIT_SUCCESS; |
171 | } | 171 | } |
172 | 172 | ||
173 | /* $Id: nslookup.c,v 1.12 2000/09/25 21:45:58 andersen Exp $ */ | 173 | /* $Id: nslookup.c,v 1.13 2000/12/01 02:55:13 kraai Exp $ */ |
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.26 2000/11/14 23:29:24 andersen Exp $ | 3 | * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -256,7 +256,7 @@ extern int ping_main(int argc, char **argv) | |||
256 | if (argc < 1) | 256 | if (argc < 1) |
257 | usage(ping_usage); | 257 | usage(ping_usage); |
258 | ping(*argv); | 258 | ping(*argv); |
259 | exit(TRUE); | 259 | return EXIT_SUCCESS; |
260 | } | 260 | } |
261 | 261 | ||
262 | #else /* ! BB_FEATURE_SIMPLE_PING */ | 262 | #else /* ! BB_FEATURE_SIMPLE_PING */ |
@@ -546,7 +546,7 @@ extern int ping_main(int argc, char **argv) | |||
546 | 546 | ||
547 | myid = getpid() & 0xFFFF; | 547 | myid = getpid() & 0xFFFF; |
548 | ping(*argv); | 548 | ping(*argv); |
549 | return(TRUE); | 549 | return EXIT_SUCCESS; |
550 | } | 550 | } |
551 | #endif /* ! BB_FEATURE_SIMPLE_PING */ | 551 | #endif /* ! BB_FEATURE_SIMPLE_PING */ |
552 | 552 | ||
diff --git a/procps/free.c b/procps/free.c index a33fa9a59..f2e746e39 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -60,7 +60,7 @@ extern int free_main(int argc, char **argv) | |||
60 | printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap, | 60 | printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap, |
61 | (info.totalram-info.freeram)+(info.totalswap-info.freeswap), | 61 | (info.totalram-info.freeram)+(info.totalswap-info.freeswap), |
62 | info.freeram+info.freeswap); | 62 | info.freeram+info.freeswap); |
63 | return(TRUE); | 63 | return EXIT_SUCCESS; |
64 | } | 64 | } |
65 | 65 | ||
66 | 66 | ||
diff --git a/procps/kill.c b/procps/kill.c index 7ade8228c..dd5ca49fa 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -158,7 +158,7 @@ extern int kill_main(int argc, char **argv) | |||
158 | } | 158 | } |
159 | } | 159 | } |
160 | fprintf(stderr, "\n\n"); | 160 | fprintf(stderr, "\n\n"); |
161 | exit(TRUE); | 161 | return EXIT_SUCCESS; |
162 | } | 162 | } |
163 | break; | 163 | break; |
164 | case '-': | 164 | case '-': |
@@ -236,11 +236,12 @@ extern int kill_main(int argc, char **argv) | |||
236 | * upon exit, so we can save a byte or two */ | 236 | * upon exit, so we can save a byte or two */ |
237 | argv++; | 237 | argv++; |
238 | } | 238 | } |
239 | exit (all_found); | 239 | if (all_found == FALSE) |
240 | return EXIT_FAILURE; | ||
240 | } | 241 | } |
241 | #endif | 242 | #endif |
242 | 243 | ||
243 | exit(TRUE); | 244 | return EXIT_SUCCESS; |
244 | 245 | ||
245 | 246 | ||
246 | end: | 247 | end: |
diff --git a/procps/ps.c b/procps/ps.c index df321612a..4998e15b1 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -183,7 +183,7 @@ extern int ps_main(int argc, char **argv) | |||
183 | fprintf(stdout, "\n"); | 183 | fprintf(stdout, "\n"); |
184 | } | 184 | } |
185 | closedir(dir); | 185 | closedir(dir); |
186 | return(TRUE); | 186 | return EXIT_SUCCESS; |
187 | } | 187 | } |
188 | 188 | ||
189 | 189 | ||
diff --git a/procps/uptime.c b/procps/uptime.c index fe4e48cd6..159f24baa 100644 --- a/procps/uptime.c +++ b/procps/uptime.c | |||
@@ -70,5 +70,5 @@ extern int uptime_main(int argc, char **argv) | |||
70 | LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), | 70 | LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), |
71 | LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2])); | 71 | LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2])); |
72 | 72 | ||
73 | return(TRUE); | 73 | return EXIT_SUCCESS; |
74 | } | 74 | } |
@@ -183,7 +183,7 @@ extern int ps_main(int argc, char **argv) | |||
183 | fprintf(stdout, "\n"); | 183 | fprintf(stdout, "\n"); |
184 | } | 184 | } |
185 | closedir(dir); | 185 | closedir(dir); |
186 | return(TRUE); | 186 | return EXIT_SUCCESS; |
187 | } | 187 | } |
188 | 188 | ||
189 | 189 | ||
@@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv) | |||
34 | fatalError("%s\n", strerror(errno)); | 34 | fatalError("%s\n", strerror(errno)); |
35 | 35 | ||
36 | printf("%s\n", buf); | 36 | printf("%s\n", buf); |
37 | return(TRUE); | 37 | return EXIT_SUCCESS; |
38 | } | 38 | } |
@@ -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 | } |
@@ -29,6 +29,6 @@ | |||
29 | extern int reset_main(int argc, char **argv) | 29 | extern int reset_main(int argc, char **argv) |
30 | { | 30 | { |
31 | printf("\033c"); | 31 | printf("\033c"); |
32 | return(TRUE); | 32 | return EXIT_SUCCESS; |
33 | } | 33 | } |
34 | 34 | ||
@@ -102,9 +102,9 @@ extern int rm_main(int argc, char **argv) | |||
102 | } else { | 102 | } else { |
103 | if (recursiveAction(srcName, recursiveFlag, FALSE, | 103 | if (recursiveAction(srcName, recursiveFlag, FALSE, |
104 | TRUE, fileAction, dirAction, NULL) == FALSE) { | 104 | TRUE, fileAction, dirAction, NULL) == FALSE) { |
105 | exit(FALSE); | 105 | return EXIT_FAILURE; |
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | return(TRUE); | 109 | return EXIT_SUCCESS; |
110 | } | 110 | } |
@@ -34,7 +34,7 @@ _syscall1(int, delete_module, const char *, name) | |||
34 | 34 | ||
35 | extern int rmmod_main(int argc, char **argv) | 35 | extern int rmmod_main(int argc, char **argv) |
36 | { | 36 | { |
37 | int ret = TRUE; | 37 | int ret = EXIT_SUCCESS; |
38 | if (argc <= 1) { | 38 | if (argc <= 1) { |
39 | usage(rmmod_usage); | 39 | usage(rmmod_usage); |
40 | } | 40 | } |
@@ -47,9 +47,9 @@ extern int rmmod_main(int argc, char **argv) | |||
47 | /* Unload _all_ unused modules via NULL delete_module() call */ | 47 | /* Unload _all_ unused modules via NULL delete_module() call */ |
48 | if (delete_module(NULL)) { | 48 | if (delete_module(NULL)) { |
49 | perror("rmmod"); | 49 | perror("rmmod"); |
50 | exit(FALSE); | 50 | return EXIT_FAILURE; |
51 | } | 51 | } |
52 | exit(TRUE); | 52 | return EXIT_SUCCESS; |
53 | default: | 53 | default: |
54 | usage(rmmod_usage); | 54 | usage(rmmod_usage); |
55 | } | 55 | } |
@@ -59,7 +59,7 @@ extern int rmmod_main(int argc, char **argv) | |||
59 | while (argc-- > 0) { | 59 | while (argc-- > 0) { |
60 | if (delete_module(*argv) < 0) { | 60 | if (delete_module(*argv) < 0) { |
61 | perror(*argv); | 61 | perror(*argv); |
62 | ret=FALSE; | 62 | ret = EXIT_FAILURE; |
63 | } | 63 | } |
64 | argv++; | 64 | argv++; |
65 | } | 65 | } |
diff --git a/setkeycodes.c b/setkeycodes.c index 63c106333..6a31e042a 100644 --- a/setkeycodes.c +++ b/setkeycodes.c | |||
@@ -68,5 +68,5 @@ setkeycodes_main(int argc, char** argv) | |||
68 | argc -= 2; | 68 | argc -= 2; |
69 | argv += 2; | 69 | argv += 2; |
70 | } | 70 | } |
71 | return( TRUE); | 71 | return EXIT_SUCCESS; |
72 | } | 72 | } |
@@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk) | |||
217 | newdir = cmd->progs[0].argv[1]; | 217 | newdir = cmd->progs[0].argv[1]; |
218 | if (chdir(newdir)) { | 218 | if (chdir(newdir)) { |
219 | printf("cd: %s: %s\n", newdir, strerror(errno)); | 219 | printf("cd: %s: %s\n", newdir, strerror(errno)); |
220 | return FALSE; | 220 | return EXIT_FAILURE; |
221 | } | 221 | } |
222 | getcwd(cwd, sizeof(char)*MAX_LINE); | 222 | getcwd(cwd, sizeof(char)*MAX_LINE); |
223 | 223 | ||
224 | return TRUE; | 224 | return EXIT_SUCCESS; |
225 | } | 225 | } |
226 | 226 | ||
227 | /* built-in 'env' handler */ | 227 | /* built-in 'env' handler */ |
@@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk) | |||
245 | fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0], | 245 | fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0], |
246 | strerror(errno)); | 246 | strerror(errno)); |
247 | } | 247 | } |
248 | return TRUE; | 248 | return EXIT_SUCCESS; |
249 | } | 249 | } |
250 | 250 | ||
251 | /* built-in 'exit' handler */ | 251 | /* built-in 'exit' handler */ |
252 | static int builtin_exit(struct job *cmd, struct jobSet *junk) | 252 | static int builtin_exit(struct job *cmd, struct jobSet *junk) |
253 | { | 253 | { |
254 | if (!cmd->progs[0].argv[1] == 1) | 254 | if (!cmd->progs[0].argv[1] == 1) |
255 | exit TRUE; | 255 | exit(EXIT_SUCCESS); |
256 | 256 | ||
257 | exit (atoi(cmd->progs[0].argv[1])); | 257 | exit (atoi(cmd->progs[0].argv[1])); |
258 | } | 258 | } |
@@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
267 | if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { | 267 | if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { |
268 | errorMsg("%s: exactly one argument is expected\n", | 268 | errorMsg("%s: exactly one argument is expected\n", |
269 | cmd->progs[0].argv[0]); | 269 | cmd->progs[0].argv[0]); |
270 | return FALSE; | 270 | return EXIT_FAILURE; |
271 | } | 271 | } |
272 | if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) { | 272 | if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) { |
273 | errorMsg("%s: bad argument '%s'\n", | 273 | errorMsg("%s: bad argument '%s'\n", |
274 | cmd->progs[0].argv[0], cmd->progs[0].argv[1]); | 274 | cmd->progs[0].argv[0], cmd->progs[0].argv[1]); |
275 | return FALSE; | 275 | return EXIT_FAILURE; |
276 | for (job = jobList->head; job; job = job->next) { | 276 | for (job = jobList->head; job; job = job->next) { |
277 | if (job->jobId == jobNum) { | 277 | if (job->jobId == jobNum) { |
278 | break; | 278 | break; |
@@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
286 | if (!job) { | 286 | if (!job) { |
287 | errorMsg("%s: unknown job %d\n", | 287 | errorMsg("%s: unknown job %d\n", |
288 | cmd->progs[0].argv[0], jobNum); | 288 | cmd->progs[0].argv[0], jobNum); |
289 | return FALSE; | 289 | return EXIT_FAILURE; |
290 | } | 290 | } |
291 | 291 | ||
292 | if (*cmd->progs[0].argv[0] == 'f') { | 292 | if (*cmd->progs[0].argv[0] == 'f') { |
@@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
305 | 305 | ||
306 | job->stoppedProgs = 0; | 306 | job->stoppedProgs = 0; |
307 | 307 | ||
308 | return TRUE; | 308 | return EXIT_SUCCESS; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* built-in 'help' handler */ | 311 | /* built-in 'help' handler */ |
@@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk) | |||
326 | fprintf(stdout, "%s\t%s\n", x->cmd, x->descr); | 326 | fprintf(stdout, "%s\t%s\n", x->cmd, x->descr); |
327 | } | 327 | } |
328 | fprintf(stdout, "\n\n"); | 328 | fprintf(stdout, "\n\n"); |
329 | return TRUE; | 329 | return EXIT_SUCCESS; |
330 | } | 330 | } |
331 | 331 | ||
332 | /* built-in 'jobs' handler */ | 332 | /* built-in 'jobs' handler */ |
@@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList) | |||
343 | 343 | ||
344 | printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text); | 344 | printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text); |
345 | } | 345 | } |
346 | return TRUE; | 346 | return EXIT_SUCCESS; |
347 | } | 347 | } |
348 | 348 | ||
349 | 349 | ||
@@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk) | |||
352 | { | 352 | { |
353 | getcwd(cwd, sizeof(char)*MAX_LINE); | 353 | getcwd(cwd, sizeof(char)*MAX_LINE); |
354 | fprintf(stdout, "%s\n", cwd); | 354 | fprintf(stdout, "%s\n", cwd); |
355 | return TRUE; | 355 | return EXIT_SUCCESS; |
356 | } | 356 | } |
357 | 357 | ||
358 | /* built-in 'export VAR=value' handler */ | 358 | /* built-in 'export VAR=value' handler */ |
@@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk) | |||
437 | 437 | ||
438 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 438 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
439 | errorMsg("unexpected token `then'\n"); | 439 | errorMsg("unexpected token `then'\n"); |
440 | return FALSE; | 440 | return EXIT_FAILURE; |
441 | } | 441 | } |
442 | /* If the if result was FALSE, skip the 'then' stuff */ | 442 | /* If the if result was FALSE, skip the 'then' stuff */ |
443 | if (cmd->jobContext & IF_FALSE_CONTEXT) { | 443 | if (cmd->jobContext & IF_FALSE_CONTEXT) { |
444 | return TRUE; | 444 | return EXIT_SUCCESS; |
445 | } | 445 | } |
446 | 446 | ||
447 | cmd->jobContext |= THEN_EXP_CONTEXT; | 447 | cmd->jobContext |= THEN_EXP_CONTEXT; |
@@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk) | |||
464 | 464 | ||
465 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 465 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
466 | errorMsg("unexpected token `else'\n"); | 466 | errorMsg("unexpected token `else'\n"); |
467 | return FALSE; | 467 | return EXIT_FAILURE; |
468 | } | 468 | } |
469 | /* If the if result was TRUE, skip the 'else' stuff */ | 469 | /* If the if result was TRUE, skip the 'else' stuff */ |
470 | if (cmd->jobContext & IF_TRUE_CONTEXT) { | 470 | if (cmd->jobContext & IF_TRUE_CONTEXT) { |
471 | return TRUE; | 471 | return EXIT_SUCCESS; |
472 | } | 472 | } |
473 | 473 | ||
474 | cmd->jobContext |= ELSE_EXP_CONTEXT; | 474 | cmd->jobContext |= ELSE_EXP_CONTEXT; |
@@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk) | |||
488 | { | 488 | { |
489 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 489 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
490 | errorMsg("unexpected token `fi'\n"); | 490 | errorMsg("unexpected token `fi'\n"); |
491 | return FALSE; | 491 | return EXIT_FAILURE; |
492 | } | 492 | } |
493 | /* Clear out the if and then context bits */ | 493 | /* Clear out the if and then context bits */ |
494 | cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT); | 494 | cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT); |
495 | debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext); | 495 | debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext); |
496 | return TRUE; | 496 | return EXIT_SUCCESS; |
497 | } | 497 | } |
498 | #endif | 498 | #endif |
499 | 499 | ||
@@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk) | |||
504 | int status; | 504 | int status; |
505 | 505 | ||
506 | if (!cmd->progs[0].argv[1] == 1) | 506 | if (!cmd->progs[0].argv[1] == 1) |
507 | return FALSE; | 507 | return EXIT_FAILURE; |
508 | 508 | ||
509 | input = fopen(cmd->progs[0].argv[1], "r"); | 509 | input = fopen(cmd->progs[0].argv[1], "r"); |
510 | if (!input) { | 510 | if (!input) { |
511 | fprintf(stdout, "Couldn't open file '%s'\n", | 511 | fprintf(stdout, "Couldn't open file '%s'\n", |
512 | cmd->progs[0].argv[1]); | 512 | cmd->progs[0].argv[1]); |
513 | return FALSE; | 513 | return EXIT_FAILURE; |
514 | } | 514 | } |
515 | 515 | ||
516 | /* Now run the file */ | 516 | /* Now run the file */ |
@@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk) | |||
524 | { | 524 | { |
525 | if (!cmd->progs[0].argv[1] == 1) { | 525 | if (!cmd->progs[0].argv[1] == 1) { |
526 | fprintf(stdout, "unset: parameter required.\n"); | 526 | fprintf(stdout, "unset: parameter required.\n"); |
527 | return FALSE; | 527 | return EXIT_FAILURE; |
528 | } | 528 | } |
529 | unsetenv(cmd->progs[0].argv[1]); | 529 | unsetenv(cmd->progs[0].argv[1]); |
530 | return TRUE; | 530 | return EXIT_SUCCESS; |
531 | } | 531 | } |
532 | 532 | ||
533 | /* free up all memory from a job */ | 533 | /* free up all memory from a job */ |
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 8115e5259..94b8fc7b1 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -135,7 +135,7 @@ void clean_up_and_die(int sig) | |||
135 | cmdedit_reset_term(); | 135 | cmdedit_reset_term(); |
136 | fprintf(stdout, "\n"); | 136 | fprintf(stdout, "\n"); |
137 | if (sig!=SIGINT) | 137 | if (sig!=SIGINT) |
138 | exit(TRUE); | 138 | exit(EXIT_SUCCESS); |
139 | } | 139 | } |
140 | 140 | ||
141 | /* Go to HOME position */ | 141 | /* Go to HOME position */ |
diff --git a/shell/lash.c b/shell/lash.c index 461f2c092..1524ef16b 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk) | |||
217 | newdir = cmd->progs[0].argv[1]; | 217 | newdir = cmd->progs[0].argv[1]; |
218 | if (chdir(newdir)) { | 218 | if (chdir(newdir)) { |
219 | printf("cd: %s: %s\n", newdir, strerror(errno)); | 219 | printf("cd: %s: %s\n", newdir, strerror(errno)); |
220 | return FALSE; | 220 | return EXIT_FAILURE; |
221 | } | 221 | } |
222 | getcwd(cwd, sizeof(char)*MAX_LINE); | 222 | getcwd(cwd, sizeof(char)*MAX_LINE); |
223 | 223 | ||
224 | return TRUE; | 224 | return EXIT_SUCCESS; |
225 | } | 225 | } |
226 | 226 | ||
227 | /* built-in 'env' handler */ | 227 | /* built-in 'env' handler */ |
@@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk) | |||
245 | fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0], | 245 | fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0], |
246 | strerror(errno)); | 246 | strerror(errno)); |
247 | } | 247 | } |
248 | return TRUE; | 248 | return EXIT_SUCCESS; |
249 | } | 249 | } |
250 | 250 | ||
251 | /* built-in 'exit' handler */ | 251 | /* built-in 'exit' handler */ |
252 | static int builtin_exit(struct job *cmd, struct jobSet *junk) | 252 | static int builtin_exit(struct job *cmd, struct jobSet *junk) |
253 | { | 253 | { |
254 | if (!cmd->progs[0].argv[1] == 1) | 254 | if (!cmd->progs[0].argv[1] == 1) |
255 | exit TRUE; | 255 | exit(EXIT_SUCCESS); |
256 | 256 | ||
257 | exit (atoi(cmd->progs[0].argv[1])); | 257 | exit (atoi(cmd->progs[0].argv[1])); |
258 | } | 258 | } |
@@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
267 | if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { | 267 | if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) { |
268 | errorMsg("%s: exactly one argument is expected\n", | 268 | errorMsg("%s: exactly one argument is expected\n", |
269 | cmd->progs[0].argv[0]); | 269 | cmd->progs[0].argv[0]); |
270 | return FALSE; | 270 | return EXIT_FAILURE; |
271 | } | 271 | } |
272 | if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) { | 272 | if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) { |
273 | errorMsg("%s: bad argument '%s'\n", | 273 | errorMsg("%s: bad argument '%s'\n", |
274 | cmd->progs[0].argv[0], cmd->progs[0].argv[1]); | 274 | cmd->progs[0].argv[0], cmd->progs[0].argv[1]); |
275 | return FALSE; | 275 | return EXIT_FAILURE; |
276 | for (job = jobList->head; job; job = job->next) { | 276 | for (job = jobList->head; job; job = job->next) { |
277 | if (job->jobId == jobNum) { | 277 | if (job->jobId == jobNum) { |
278 | break; | 278 | break; |
@@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
286 | if (!job) { | 286 | if (!job) { |
287 | errorMsg("%s: unknown job %d\n", | 287 | errorMsg("%s: unknown job %d\n", |
288 | cmd->progs[0].argv[0], jobNum); | 288 | cmd->progs[0].argv[0], jobNum); |
289 | return FALSE; | 289 | return EXIT_FAILURE; |
290 | } | 290 | } |
291 | 291 | ||
292 | if (*cmd->progs[0].argv[0] == 'f') { | 292 | if (*cmd->progs[0].argv[0] == 'f') { |
@@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList) | |||
305 | 305 | ||
306 | job->stoppedProgs = 0; | 306 | job->stoppedProgs = 0; |
307 | 307 | ||
308 | return TRUE; | 308 | return EXIT_SUCCESS; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* built-in 'help' handler */ | 311 | /* built-in 'help' handler */ |
@@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk) | |||
326 | fprintf(stdout, "%s\t%s\n", x->cmd, x->descr); | 326 | fprintf(stdout, "%s\t%s\n", x->cmd, x->descr); |
327 | } | 327 | } |
328 | fprintf(stdout, "\n\n"); | 328 | fprintf(stdout, "\n\n"); |
329 | return TRUE; | 329 | return EXIT_SUCCESS; |
330 | } | 330 | } |
331 | 331 | ||
332 | /* built-in 'jobs' handler */ | 332 | /* built-in 'jobs' handler */ |
@@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList) | |||
343 | 343 | ||
344 | printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text); | 344 | printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text); |
345 | } | 345 | } |
346 | return TRUE; | 346 | return EXIT_SUCCESS; |
347 | } | 347 | } |
348 | 348 | ||
349 | 349 | ||
@@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk) | |||
352 | { | 352 | { |
353 | getcwd(cwd, sizeof(char)*MAX_LINE); | 353 | getcwd(cwd, sizeof(char)*MAX_LINE); |
354 | fprintf(stdout, "%s\n", cwd); | 354 | fprintf(stdout, "%s\n", cwd); |
355 | return TRUE; | 355 | return EXIT_SUCCESS; |
356 | } | 356 | } |
357 | 357 | ||
358 | /* built-in 'export VAR=value' handler */ | 358 | /* built-in 'export VAR=value' handler */ |
@@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk) | |||
437 | 437 | ||
438 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 438 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
439 | errorMsg("unexpected token `then'\n"); | 439 | errorMsg("unexpected token `then'\n"); |
440 | return FALSE; | 440 | return EXIT_FAILURE; |
441 | } | 441 | } |
442 | /* If the if result was FALSE, skip the 'then' stuff */ | 442 | /* If the if result was FALSE, skip the 'then' stuff */ |
443 | if (cmd->jobContext & IF_FALSE_CONTEXT) { | 443 | if (cmd->jobContext & IF_FALSE_CONTEXT) { |
444 | return TRUE; | 444 | return EXIT_SUCCESS; |
445 | } | 445 | } |
446 | 446 | ||
447 | cmd->jobContext |= THEN_EXP_CONTEXT; | 447 | cmd->jobContext |= THEN_EXP_CONTEXT; |
@@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk) | |||
464 | 464 | ||
465 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 465 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
466 | errorMsg("unexpected token `else'\n"); | 466 | errorMsg("unexpected token `else'\n"); |
467 | return FALSE; | 467 | return EXIT_FAILURE; |
468 | } | 468 | } |
469 | /* If the if result was TRUE, skip the 'else' stuff */ | 469 | /* If the if result was TRUE, skip the 'else' stuff */ |
470 | if (cmd->jobContext & IF_TRUE_CONTEXT) { | 470 | if (cmd->jobContext & IF_TRUE_CONTEXT) { |
471 | return TRUE; | 471 | return EXIT_SUCCESS; |
472 | } | 472 | } |
473 | 473 | ||
474 | cmd->jobContext |= ELSE_EXP_CONTEXT; | 474 | cmd->jobContext |= ELSE_EXP_CONTEXT; |
@@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk) | |||
488 | { | 488 | { |
489 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { | 489 | if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) { |
490 | errorMsg("unexpected token `fi'\n"); | 490 | errorMsg("unexpected token `fi'\n"); |
491 | return FALSE; | 491 | return EXIT_FAILURE; |
492 | } | 492 | } |
493 | /* Clear out the if and then context bits */ | 493 | /* Clear out the if and then context bits */ |
494 | cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT); | 494 | cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT); |
495 | debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext); | 495 | debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext); |
496 | return TRUE; | 496 | return EXIT_SUCCESS; |
497 | } | 497 | } |
498 | #endif | 498 | #endif |
499 | 499 | ||
@@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk) | |||
504 | int status; | 504 | int status; |
505 | 505 | ||
506 | if (!cmd->progs[0].argv[1] == 1) | 506 | if (!cmd->progs[0].argv[1] == 1) |
507 | return FALSE; | 507 | return EXIT_FAILURE; |
508 | 508 | ||
509 | input = fopen(cmd->progs[0].argv[1], "r"); | 509 | input = fopen(cmd->progs[0].argv[1], "r"); |
510 | if (!input) { | 510 | if (!input) { |
511 | fprintf(stdout, "Couldn't open file '%s'\n", | 511 | fprintf(stdout, "Couldn't open file '%s'\n", |
512 | cmd->progs[0].argv[1]); | 512 | cmd->progs[0].argv[1]); |
513 | return FALSE; | 513 | return EXIT_FAILURE; |
514 | } | 514 | } |
515 | 515 | ||
516 | /* Now run the file */ | 516 | /* Now run the file */ |
@@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk) | |||
524 | { | 524 | { |
525 | if (!cmd->progs[0].argv[1] == 1) { | 525 | if (!cmd->progs[0].argv[1] == 1) { |
526 | fprintf(stdout, "unset: parameter required.\n"); | 526 | fprintf(stdout, "unset: parameter required.\n"); |
527 | return FALSE; | 527 | return EXIT_FAILURE; |
528 | } | 528 | } |
529 | unsetenv(cmd->progs[0].argv[1]); | 529 | unsetenv(cmd->progs[0].argv[1]); |
530 | return TRUE; | 530 | return EXIT_SUCCESS; |
531 | } | 531 | } |
532 | 532 | ||
533 | /* free up all memory from a job */ | 533 | /* free up all memory from a job */ |
@@ -32,7 +32,7 @@ extern int sleep_main(int argc, char **argv) | |||
32 | 32 | ||
33 | if (sleep(atoi(*(++argv))) != 0) { | 33 | if (sleep(atoi(*(++argv))) != 0) { |
34 | perror("sleep"); | 34 | perror("sleep"); |
35 | exit(FALSE); | 35 | return EXIT_FAILURE; |
36 | } | 36 | } |
37 | return(TRUE); | 37 | return EXIT_SUCCESS; |
38 | } | 38 | } |
diff --git a/swaponoff.c b/swaponoff.c index 4a1c8f93f..0ae0c36ee 100644 --- a/swaponoff.c +++ b/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/sysklogd/syslogd.c b/sysklogd/syslogd.c index 9bedc84f2..a5071583d 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -568,7 +568,7 @@ extern int syslogd_main(int argc, char **argv) | |||
568 | doSyslogd(); | 568 | doSyslogd(); |
569 | } | 569 | } |
570 | 570 | ||
571 | return(TRUE); | 571 | return EXIT_SUCCESS; |
572 | } | 572 | } |
573 | 573 | ||
574 | /* | 574 | /* |
@@ -568,7 +568,7 @@ extern int syslogd_main(int argc, char **argv) | |||
568 | doSyslogd(); | 568 | doSyslogd(); |
569 | } | 569 | } |
570 | 570 | ||
571 | return(TRUE); | 571 | return EXIT_SUCCESS; |
572 | } | 572 | } |
573 | 573 | ||
574 | /* | 574 | /* |
@@ -156,6 +156,7 @@ extern int tar_main(int argc, char **argv) | |||
156 | int tostdoutFlag = FALSE; | 156 | int tostdoutFlag = FALSE; |
157 | int firstOpt = TRUE; | 157 | int firstOpt = TRUE; |
158 | int stopIt; | 158 | int stopIt; |
159 | int status; | ||
159 | 160 | ||
160 | 161 | ||
161 | if (argc <= 1) | 162 | if (argc <= 1) |
@@ -227,16 +228,21 @@ extern int tar_main(int argc, char **argv) | |||
227 | #ifndef BB_FEATURE_TAR_CREATE | 228 | #ifndef BB_FEATURE_TAR_CREATE |
228 | fatalError( "This version of tar was not compiled with tar creation support.\n"); | 229 | fatalError( "This version of tar was not compiled with tar creation support.\n"); |
229 | #else | 230 | #else |
230 | exit(writeTarFile(tarName, verboseFlag, argv, excludeList)); | 231 | status = writeTarFile(tarName, verboseFlag, argv, excludeList); |
231 | #endif | 232 | #endif |
232 | } | 233 | } |
233 | if (listFlag == TRUE || extractFlag == TRUE) { | 234 | if (listFlag == TRUE || extractFlag == TRUE) { |
234 | if (*argv) | 235 | if (*argv) |
235 | extractList = argv; | 236 | extractList = argv; |
236 | exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, | 237 | status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, |
237 | verboseFlag, extractList, excludeList)); | 238 | verboseFlag, extractList, excludeList); |
238 | } | 239 | } |
239 | 240 | ||
241 | if (status == TRUE) | ||
242 | return EXIT_SUCCESS; | ||
243 | else | ||
244 | return EXIT_FAILURE; | ||
245 | |||
240 | flagError: | 246 | flagError: |
241 | fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n"); | 247 | fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n"); |
242 | } | 248 | } |
@@ -43,7 +43,6 @@ extern int touch_main(int argc, char **argv) | |||
43 | break; | 43 | break; |
44 | default: | 44 | default: |
45 | usage(touch_usage); | 45 | usage(touch_usage); |
46 | exit(FALSE); | ||
47 | } | 46 | } |
48 | } | 47 | } |
49 | } | 48 | } |
@@ -57,7 +56,7 @@ extern int touch_main(int argc, char **argv) | |||
57 | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); | 56 | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); |
58 | if (fd < 0) { | 57 | if (fd < 0) { |
59 | if (create == FALSE && errno == ENOENT) | 58 | if (create == FALSE && errno == ENOENT) |
60 | exit(TRUE); | 59 | return EXIT_SUCCESS; |
61 | else { | 60 | else { |
62 | fatalError("%s", strerror(errno)); | 61 | fatalError("%s", strerror(errno)); |
63 | } | 62 | } |
@@ -70,5 +69,5 @@ extern int touch_main(int argc, char **argv) | |||
70 | argv++; | 69 | argv++; |
71 | } | 70 | } |
72 | 71 | ||
73 | return(TRUE); | 72 | return EXIT_SUCCESS; |
74 | } | 73 | } |
diff --git a/true_false.c b/true_false.c index b3b221e1f..333541c9b 100644 --- a/true_false.c +++ b/true_false.c | |||
@@ -27,10 +27,10 @@ | |||
27 | 27 | ||
28 | extern int true_main(int argc, char **argv) | 28 | extern int true_main(int argc, char **argv) |
29 | { | 29 | { |
30 | return(TRUE); | 30 | return EXIT_SUCCESS; |
31 | } | 31 | } |
32 | 32 | ||
33 | extern int false_main(int argc, char **argv) | 33 | extern int false_main(int argc, char **argv) |
34 | { | 34 | { |
35 | return(FALSE); | 35 | return EXIT_FAILURE; |
36 | } | 36 | } |
@@ -38,5 +38,5 @@ extern int tty_main(int argc, char **argv) | |||
38 | else | 38 | else |
39 | puts("not a tty"); | 39 | puts("not a tty"); |
40 | } | 40 | } |
41 | return(isatty(0) ? TRUE : FALSE); | 41 | return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE); |
42 | } | 42 | } |
@@ -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 | ||
@@ -138,7 +138,7 @@ int uname_main(int argc, char **argv) | |||
138 | print_element(PRINT_MACHINE, name.machine); | 138 | print_element(PRINT_MACHINE, name.machine); |
139 | print_element(PRINT_PROCESSOR, processor); | 139 | print_element(PRINT_PROCESSOR, processor); |
140 | 140 | ||
141 | return(TRUE); | 141 | return EXIT_SUCCESS; |
142 | } | 142 | } |
143 | 143 | ||
144 | /* If the name element set in MASK is selected for printing in `toprint', | 144 | /* If the name element set in MASK is selected for printing in `toprint', |
@@ -67,7 +67,7 @@ extern int update_main(int argc, char **argv) | |||
67 | 67 | ||
68 | pid = fork(); | 68 | pid = fork(); |
69 | if (pid < 0) | 69 | if (pid < 0) |
70 | exit(FALSE); | 70 | return EXIT_FAILURE; |
71 | else if (pid == 0) { | 71 | else if (pid == 0) { |
72 | /* Become a proper daemon */ | 72 | /* Become a proper daemon */ |
73 | setsid(); | 73 | setsid(); |
@@ -99,12 +99,12 @@ extern int update_main(int argc, char **argv) | |||
99 | syslog(LOG_INFO, | 99 | syslog(LOG_INFO, |
100 | "This kernel does not need update(8). Exiting."); | 100 | "This kernel does not need update(8). Exiting."); |
101 | closelog(); | 101 | closelog(); |
102 | exit(TRUE); | 102 | return EXIT_SUCCESS; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
106 | } | 106 | } |
107 | return( TRUE); | 107 | return EXIT_SUCCESS; |
108 | } | 108 | } |
109 | 109 | ||
110 | /* | 110 | /* |
@@ -70,5 +70,5 @@ extern int uptime_main(int argc, char **argv) | |||
70 | LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), | 70 | LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), |
71 | LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2])); | 71 | LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2])); |
72 | 72 | ||
73 | return(TRUE); | 73 | return EXIT_SUCCESS; |
74 | } | 74 | } |
@@ -32,5 +32,5 @@ extern int usleep_main(int argc, char **argv) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | usleep(atoi(*(++argv))); /* return void */ | 34 | usleep(atoi(*(++argv))); /* return void */ |
35 | return(TRUE); | 35 | return EXIT_SUCCESS; |
36 | } | 36 | } |
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) | |||
176 | void die(const char *str) | 176 | void 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 | ||
182 | void page_ok(int page) | 182 | void 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 | |||
517 | goodbye: | 515 | goodbye: |
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 | ||
diff --git a/uudecode.c b/uudecode.c index 78ca0968d..825fdb562 100644 --- a/uudecode.c +++ b/uudecode.c | |||
@@ -294,16 +294,16 @@ int uudecode_main (int argc, | |||
294 | } | 294 | } |
295 | 295 | ||
296 | if (optind == argc) | 296 | if (optind == argc) |
297 | exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE; | 297 | exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE; |
298 | else { | 298 | else { |
299 | exit_status = TRUE; | 299 | exit_status = EXIT_SUCCESS; |
300 | do { | 300 | do { |
301 | if (freopen (argv[optind], "r", stdin) != NULL) { | 301 | if (freopen (argv[optind], "r", stdin) != NULL) { |
302 | if (decode (argv[optind], outname) != 0) | 302 | if (decode (argv[optind], outname) != 0) |
303 | exit_status = FALSE; | 303 | exit_status = FALSE; |
304 | } else { | 304 | } else { |
305 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 305 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); |
306 | exit_status = FALSE; | 306 | exit_status = EXIT_FAILURE; |
307 | } | 307 | } |
308 | optind++; | 308 | optind++; |
309 | } | 309 | } |
diff --git a/uuencode.c b/uuencode.c index aea99ed87..8d15adbf6 100644 --- a/uuencode.c +++ b/uuencode.c | |||
@@ -179,7 +179,7 @@ int uuencode_main (int argc, | |||
179 | /* Optional first argument is input file. */ | 179 | /* Optional first argument is input file. */ |
180 | if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { | 180 | if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { |
181 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); | 181 | errorMsg("%s: %s\n", argv[optind], strerror(errno)); |
182 | exit FALSE; | 182 | return EXIT_FAILURE; |
183 | } | 183 | } |
184 | mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); | 184 | mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); |
185 | optind++; | 185 | optind++; |
@@ -200,9 +200,9 @@ int uuencode_main (int argc, | |||
200 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); | 200 | printf(trans_ptr == uu_std ? "end\n" : "====\n"); |
201 | if (ferror (stdout)) { | 201 | if (ferror (stdout)) { |
202 | errorMsg("Write error\n"); | 202 | errorMsg("Write error\n"); |
203 | exit FALSE; | 203 | return EXIT_FAILURE; |
204 | } | 204 | } |
205 | return( TRUE); | 205 | return EXIT_SUCCESS; |
206 | } | 206 | } |
207 | 207 | ||
208 | /* Copyright (c) 1983 Regents of the University of California. | 208 | /* Copyright (c) 1983 Regents of the University of California. |