summaryrefslogtreecommitdiff
path: root/coreutils/md5sum.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/md5sum.c')
-rw-r--r--coreutils/md5sum.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index f5be448..c1480cd 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -770,13 +770,13 @@ static int md5_file(const char *filename,
have_read_stdin = 1;
fp = stdin;
} else {
- fp = wfopen(filename, "r");
+ fp = bb_wfopen(filename, "r");
if (fp == NULL)
return FALSE;
}
if (md5_stream(fp, md5_result)) {
- perror_msg("%s", filename);
+ bb_perror_msg("%s", filename);
if (fp != stdin)
fclose(fp);
@@ -784,7 +784,7 @@ static int md5_file(const char *filename,
}
if (fp != stdin && fclose(fp) == EOF) {
- perror_msg("%s", filename);
+ bb_perror_msg("%s", filename);
return FALSE;
}
@@ -805,7 +805,7 @@ static int md5_check(const char *checkfile_name)
have_read_stdin = 1;
checkfile_stream = stdin;
} else {
- checkfile_stream = wfopen(checkfile_name, "r");
+ checkfile_stream = bb_wfopen(checkfile_name, "r");
if (checkfile_stream == NULL)
return FALSE;
}
@@ -836,7 +836,7 @@ static int md5_check(const char *checkfile_name)
if (split_3(line, line_length, &md5num, &filename)
|| !hex_digits(md5num)) {
if (warn) {
- error_msg("%s: %lu: improperly formatted MD5 checksum line",
+ bb_error_msg("%s: %lu: improperly formatted MD5 checksum line",
checkfile_name, (unsigned long) line_number);
}
} else {
@@ -881,18 +881,18 @@ static int md5_check(const char *checkfile_name)
while (!feof(checkfile_stream) && !ferror(checkfile_stream));
if (ferror(checkfile_stream)) {
- error_msg("%s: read error", checkfile_name);
+ bb_error_msg("%s: read error", checkfile_name);
return FALSE;
}
if (checkfile_stream != stdin && fclose(checkfile_stream) == EOF) {
- perror_msg("md5sum: %s", checkfile_name);
+ bb_perror_msg("md5sum: %s", checkfile_name);
return FALSE;
}
if (n_properly_formated_lines == 0) {
/* Warn if no tests are found. */
- error_msg("%s: no properly formatted MD5 checksum lines found",
+ bb_error_msg("%s: no properly formatted MD5 checksum lines found",
checkfile_name);
return FALSE;
} else {
@@ -901,13 +901,13 @@ static int md5_check(const char *checkfile_name)
- n_open_or_read_failures);
if (n_open_or_read_failures > 0) {
- error_msg("WARNING: %d of %d listed files could not be read",
+ bb_error_msg("WARNING: %d of %d listed files could not be read",
n_open_or_read_failures, n_properly_formated_lines);
return FALSE;
}
if (n_mismatched_checksums > 0) {
- error_msg("WARNING: %d of %d computed checksums did NOT match",
+ bb_error_msg("WARNING: %d of %d computed checksums did NOT match",
n_mismatched_checksums, n_computed_checkums);
return FALSE;
}
@@ -965,31 +965,31 @@ int md5sum_main(int argc,
break;
default:
- show_usage();
+ bb_show_usage();
}
}
if (file_type_specified && do_check) {
- error_msg_and_die("the -b and -t options are meaningless when verifying checksums");
+ bb_error_msg_and_die("the -b and -t options are meaningless when verifying checksums");
}
if (n_strings > 0 && do_check) {
- error_msg_and_die("the -g and -c options are mutually exclusive");
+ bb_error_msg_and_die("the -g and -c options are mutually exclusive");
}
if (status_only && !do_check) {
- error_msg_and_die("the -s option is meaningful only when verifying checksums");
+ bb_error_msg_and_die("the -s option is meaningful only when verifying checksums");
}
if (warn && !do_check) {
- error_msg_and_die("the -w option is meaningful only when verifying checksums");
+ bb_error_msg_and_die("the -w option is meaningful only when verifying checksums");
}
if (n_strings > 0) {
size_t i;
if (optind < argc) {
- error_msg_and_die("no files may be specified when using -g");
+ bb_error_msg_and_die("no files may be specified when using -g");
}
for (i = 0; i < n_strings; ++i) {
size_t cnt;
@@ -1002,7 +1002,7 @@ int md5sum_main(int argc,
}
} else if (do_check) {
if (optind + 1 < argc) {
- error_msg("only one argument may be specified when using -c");
+ bb_error_msg("only one argument may be specified when using -c");
}
err = md5_check ((optind == argc) ? "-" : argv[optind]);
@@ -1060,11 +1060,11 @@ int md5sum_main(int argc,
}
if (fclose (stdout) == EOF) {
- error_msg_and_die("write error");
+ bb_error_msg_and_die("write error");
}
if (have_read_stdin && fclose (stdin) == EOF) {
- error_msg_and_die("standard input");
+ bb_error_msg_and_die(bb_msg_standard_input);
}
if (err == 0)