diff options
author | Matt Kraai | 2000-12-01 02:55:13 +0000 |
---|---|---|
committer | Matt Kraai | 2000-12-01 02:55:13 +0000 |
commit | 3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0 (patch) | |
tree | 013a1e7752113314831ad7d51854ce8dc9e0918b /coreutils | |
parent | b558e76eb1ba173ce3501c3e13fb80f426a7faac (diff) | |
download | busybox-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.zip busybox-3e856ce428cabaf6c8d99a2374a1f9a4a05db5f0.tar.gz |
Stop using TRUE and FALSE for exit status.
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/basename.c | 2 | ||||
-rw-r--r-- | coreutils/chroot.c | 2 | ||||
-rw-r--r-- | coreutils/cmp.c | 2 | ||||
-rw-r--r-- | coreutils/cut.c | 2 | ||||
-rw-r--r-- | coreutils/date.c | 4 | ||||
-rw-r--r-- | coreutils/dd.c | 2 | ||||
-rw-r--r-- | coreutils/df.c | 10 | ||||
-rw-r--r-- | coreutils/dirname.c | 2 | ||||
-rw-r--r-- | coreutils/dos2unix.c | 2 | ||||
-rw-r--r-- | coreutils/du.c | 4 | ||||
-rw-r--r-- | coreutils/echo.c | 2 | ||||
-rw-r--r-- | coreutils/hostid.c | 2 | ||||
-rw-r--r-- | coreutils/length.c | 2 | ||||
-rw-r--r-- | coreutils/ls.c | 1 | ||||
-rw-r--r-- | coreutils/md5sum.c | 19 | ||||
-rw-r--r-- | coreutils/mkdir.c | 10 | ||||
-rw-r--r-- | coreutils/mkfifo.c | 4 | ||||
-rw-r--r-- | coreutils/mknod.c | 2 | ||||
-rw-r--r-- | coreutils/pwd.c | 2 | ||||
-rw-r--r-- | coreutils/rm.c | 4 | ||||
-rw-r--r-- | coreutils/sleep.c | 4 | ||||
-rw-r--r-- | coreutils/touch.c | 5 | ||||
-rw-r--r-- | coreutils/tty.c | 2 | ||||
-rw-r--r-- | coreutils/uname.c | 2 | ||||
-rw-r--r-- | coreutils/usleep.c | 2 | ||||
-rw-r--r-- | coreutils/uudecode.c | 6 | ||||
-rw-r--r-- | coreutils/uuencode.c | 6 |
27 files changed, 54 insertions, 53 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c index 4d9fc4e..fcc7d46 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c @@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv) s[m-n] = '\0'; } printf("%s\n", s); - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/chroot.c b/coreutils/chroot.c index f0a2981..f279af1 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c @@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv) execlp(prog, prog, NULL); #else shell_main(argc, argv); - exit (0); + return EXIT_SUCCESS; #endif } fatalError("cannot execute %s: %s\n", prog, strerror(errno)); diff --git a/coreutils/cmp.c b/coreutils/cmp.c index 98b747e..6b95544 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c @@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv) else printf("%s %s differ: char %d, line %d\n", filename1, filename2, char_pos, line_pos); - return 1; + return EXIT_FAILURE; } char_pos++; if (c1 == '\n') diff --git a/coreutils/cut.c b/coreutils/cut.c index 2d313cc..b281fa2 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv) } } - return 0; + return EXIT_SUCCESS; } diff --git a/coreutils/date.c b/coreutils/date.c index 7e42167..2e69bde 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -232,7 +232,7 @@ int date_main(int argc, char **argv) } else if (*date_fmt == '\0') { /* Imitate what GNU 'date' does with NO format string! */ printf("\n"); - exit(TRUE); + return EXIT_SUCCESS; } /* Handle special conversions */ @@ -246,5 +246,5 @@ int date_main(int argc, char **argv) strftime(t_buff, 200, date_fmt, &tm_time); printf("%s\n", t_buff); - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/dd.c b/coreutils/dd.c index 2b77ea6..044f167 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv) (inTotal % blockSize) != 0); printf("%ld+%d records out\n", (long) (outTotal / blockSize), (outTotal % blockSize) != 0); - exit(TRUE); + return EXIT_SUCCESS; usage: usage(dd_usage); diff --git a/coreutils/df.c b/coreutils/df.c index 8d6242c..aefffc7 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv) exit(FALSE); } status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir); - if (status != 0) - exit(status); + if (status != TRUE) + return EXIT_FAILURE; argc--; argv++; } - exit(TRUE); + return EXIT_SUCCESS; } else { FILE *mountTable; struct mntent *mountEntry; @@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv) mountTable = setmntent(mtab_file, "r"); if (mountTable == 0) { perror(mtab_file); - exit(FALSE); + return EXIT_FAILURE; } while ((mountEntry = getmntent(mountTable))) { @@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv) endmntent(mountTable); } - return(TRUE); + return EXIT_FAILURE; } /* diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 23f46be..ceb750c 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv) if (s && *s) *s = '\0'; printf("%s\n", (s)? *argv : "."); - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index c9f783f..ed2088e 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c @@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) { putchar(c); c = getchar(); } - return 0; + return EXIT_SUCCESS; } diff --git a/coreutils/du.c b/coreutils/du.c index 408ad99..a0f1606 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -160,10 +160,10 @@ int du_main(int argc, char **argv) } } - return(0); + return EXIT_SUCCESS; } -/* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */ +/* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */ /* Local Variables: c-file-style: "linux" diff --git a/coreutils/echo.c b/coreutils/echo.c index a6b5152..393f442 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -107,7 +107,7 @@ just_echo: putchar('\n'); fflush(stdout); - return 0; + return EXIT_SUCCESS; } /*- diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 47bd8d7..35a5859 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -26,5 +26,5 @@ extern int hostid_main(int argc, char **argv) { printf("%lx\n", gethostid()); - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/length.c b/coreutils/length.c index 14d15c8..1ab4e3a 100644 --- a/coreutils/length.c +++ b/coreutils/length.c @@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv) if (argc != 2 || **(argv + 1) == '-') usage(length_usage); printf("%lu\n", (long)strlen(argv[1])); - return (TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/ls.c b/coreutils/ls.c index d508a1b..225132b 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv) print_usage_message: usage(ls_usage); - return(FALSE); } diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c index 21570de..30b882a 100644 --- a/coreutils/md5sum.c +++ b/coreutils/md5sum.c @@ -902,22 +902,22 @@ int md5sum_main(int argc, if (file_type_specified && do_check) { errorMsg("the -b and -t options are meaningless when verifying checksums\n"); - exit FALSE; + return EXIT_FAILURE; } if (n_strings > 0 && do_check) { errorMsg("the -g and -c options are mutually exclusive\n"); - exit FALSE; + return EXIT_FAILURE; } if (status_only && !do_check) { errorMsg("the -s option is meaningful only when verifying checksums\n"); - exit FALSE; + return EXIT_FAILURE; } if (warn && !do_check) { errorMsg("the -w option is meaningful only when verifying checksums\n"); - exit FALSE; + return EXIT_FAILURE; } if (n_strings > 0) { @@ -925,7 +925,7 @@ int md5sum_main(int argc, if (optind < argc) { errorMsg("no files may be specified when using -g\n"); - exit FALSE; + return EXIT_FAILURE; } for (i = 0; i < n_strings; ++i) { size_t cnt; @@ -992,13 +992,16 @@ int md5sum_main(int argc, if (fclose (stdout) == EOF) { errorMsg("write error\n"); - exit FALSE; + return EXIT_FAILURE; } if (have_read_stdin && fclose (stdin) == EOF) { errorMsg("standard input\n"); - exit FALSE; + return EXIT_FAILURE; } - exit (err == 0 ? TRUE : FALSE); + if (err == 0) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; } diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 04310e4..c950847 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv) mode = 0; if (parse_mode(*(++argv), &mode) == FALSE) { errorMsg("Unknown mode: %s\n", *argv); - exit FALSE; + return EXIT_FAILURE; } /* Set the umask for this process so it doesn't * screw up whatever the user just entered. */ @@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv) if (strlen(*argv) > BUFSIZ - 1) { errorMsg(name_too_long); - exit FALSE; + return EXIT_FAILURE; } strcpy(buf, *argv); status = stat(buf, &statBuf); if (parentFlag == FALSE && status != -1 && errno != ENOENT) { errorMsg("%s: File exists\n", buf); - exit FALSE; + return EXIT_FAILURE; } if (parentFlag == TRUE) { strcat(buf, "/"); @@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv) } else { if (mkdir(buf, mode) != 0 && parentFlag == FALSE) { perror(buf); - exit FALSE; + return EXIT_FAILURE; } } argc--; argv++; } - return( TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 5e1bc1a..ef4a525 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv) usage(mkfifo_usage); if (mkfifo(*argv, mode) < 0) { perror("mkfifo"); - exit(255); + return EXIT_FAILURE; } - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/mknod.c b/coreutils/mknod.c index ecb0e47..21b2689 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c @@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv) if (mknod(argv[0], mode, dev) != 0) fatalError("%s: %s\n", argv[0], strerror(errno)); - return (TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/pwd.c b/coreutils/pwd.c index c9de777..54129b1 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c @@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv) fatalError("%s\n", strerror(errno)); printf("%s\n", buf); - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/rm.c b/coreutils/rm.c index 4f97cad..c62083e 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c @@ -102,9 +102,9 @@ extern int rm_main(int argc, char **argv) } else { if (recursiveAction(srcName, recursiveFlag, FALSE, TRUE, fileAction, dirAction, NULL) == FALSE) { - exit(FALSE); + return EXIT_FAILURE; } } } - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 709e3de..ad92b10 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -32,7 +32,7 @@ extern int sleep_main(int argc, char **argv) if (sleep(atoi(*(++argv))) != 0) { perror("sleep"); - exit(FALSE); + return EXIT_FAILURE; } - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/touch.c b/coreutils/touch.c index 7db6c6e..5537fb6 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -43,7 +43,6 @@ extern int touch_main(int argc, char **argv) break; default: usage(touch_usage); - exit(FALSE); } } } @@ -57,7 +56,7 @@ extern int touch_main(int argc, char **argv) S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if (fd < 0) { if (create == FALSE && errno == ENOENT) - exit(TRUE); + return EXIT_SUCCESS; else { fatalError("%s", strerror(errno)); } @@ -70,5 +69,5 @@ extern int touch_main(int argc, char **argv) argv++; } - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/tty.c b/coreutils/tty.c index 6eebed9..46201d3 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -38,5 +38,5 @@ extern int tty_main(int argc, char **argv) else puts("not a tty"); } - return(isatty(0) ? TRUE : FALSE); + return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/coreutils/uname.c b/coreutils/uname.c index 8d9427c..2781b80 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -138,7 +138,7 @@ int uname_main(int argc, char **argv) print_element(PRINT_MACHINE, name.machine); print_element(PRINT_PROCESSOR, processor); - return(TRUE); + return EXIT_SUCCESS; } /* If the name element set in MASK is selected for printing in `toprint', diff --git a/coreutils/usleep.c b/coreutils/usleep.c index 69790ef..86dc050 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c @@ -32,5 +32,5 @@ extern int usleep_main(int argc, char **argv) } usleep(atoi(*(++argv))); /* return void */ - return(TRUE); + return EXIT_SUCCESS; } diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 78ca096..825fdb5 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -294,16 +294,16 @@ int uudecode_main (int argc, } if (optind == argc) - exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE; + exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE; else { - exit_status = TRUE; + exit_status = EXIT_SUCCESS; do { if (freopen (argv[optind], "r", stdin) != NULL) { if (decode (argv[optind], outname) != 0) exit_status = FALSE; } else { errorMsg("%s: %s\n", argv[optind], strerror(errno)); - exit_status = FALSE; + exit_status = EXIT_FAILURE; } optind++; } diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index aea99ed..8d15adb 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -179,7 +179,7 @@ int uuencode_main (int argc, /* Optional first argument is input file. */ if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) { errorMsg("%s: %s\n", argv[optind], strerror(errno)); - exit FALSE; + return EXIT_FAILURE; } mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); optind++; @@ -200,9 +200,9 @@ int uuencode_main (int argc, printf(trans_ptr == uu_std ? "end\n" : "====\n"); if (ferror (stdout)) { errorMsg("Write error\n"); - exit FALSE; + return EXIT_FAILURE; } - return( TRUE); + return EXIT_SUCCESS; } /* Copyright (c) 1983 Regents of the University of California. |