foo*sum: report I/O errors, don't merely exit with 1.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3e7ecb179b
commit
cd8eece88e
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user