From: Denys Vlasenko Date: Tue, 2 Jul 2013 17:11:01 +0000 (+0200) Subject: foo*sum: report I/O errors, don't merely exit with 1. X-Git-Tag: 1_22_0~162 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cd8eece88ed6da58209a18a8c3edac73eab27e1c;p=oweals%2Fbusybox.git foo*sum: report I/O errors, don't merely exit with 1. Signed-off-by: Denys Vlasenko --- diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index 92a4d4462..b23c6c0ff 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c @@ -151,7 +151,9 @@ static uint8_t *hash_file(const char *filename) update(&context, in_buf, count); } hash_value = NULL; - if (count == 0) { + if (count < 0) { + bb_perror_msg("can't read '%s'", filename); + else /* count == 0 */ { final(&context, in_buf); hash_value = hash_bin_to_hex(in_buf, hash_len); }