Stop using TRUE and FALSE for exit status.
[oweals/busybox.git] / coreutils / md5sum.c
index a791a41b0a5a90b17fc0e68c2af435fc9942e19d..30b882ab55d8e29f56187344a07a7fe86d7c55bf 100644 (file)
@@ -20,7 +20,7 @@
 /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu> */
 /* Hacked to work with BusyBox by Alfred M. Szmidt <ams@trillian.itslinux.org> */
 
-#include "internal.h"
+#include "busybox.h"
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>
@@ -66,7 +66,7 @@ extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
 #include <string.h>
 #include <endian.h>
 
-#include "internal.h"
+#include "busybox.h"
 //----------------------------------------------------------------------------
 //--------md5.h
 //----------------------------------------------------------------------------
@@ -810,7 +810,7 @@ static int md5_check(const char *checkfile_name)
     free(line);
 
   if (ferror(checkfile_stream)) {
-    errorMsg("%s: read error", checkfile_name); /* */
+    errorMsg("%s: read error\n", checkfile_name); /* */
     return FALSE;
   }
 
@@ -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;
@@ -991,14 +991,17 @@ int md5sum_main(int argc,
   }
 
   if (fclose (stdout) == EOF) {
-    errorMsg("write error");
-    exit FALSE;
+    errorMsg("write error\n");
+       return EXIT_FAILURE;
   }
 
   if (have_read_stdin && fclose (stdin) == EOF) {
-    errorMsg("standard input");
-    exit FALSE;
+    errorMsg("standard input\n");
+       return EXIT_FAILURE;
   }
 
-  exit (err == 0 ? TRUE : FALSE);
+  if (err == 0)
+         return EXIT_SUCCESS;
+  else
+         return EXIT_FAILURE;
 }