From cb67d87b9fd36bee8b0d6e6d229b6fafaeac0adf Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Thu, 18 Jul 2024 11:12:01 +0200 Subject: [PATCH] Fix checksum(1) --status emitting warnings. --- checksum/checksum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checksum/checksum.c b/checksum/checksum.c index 9caa39c3..701f8d99 100644 --- a/checksum/checksum.c +++ b/checksum/checksum.c @@ -299,10 +299,10 @@ static int checklist_fp(FILE* fp, explicit_bzero(checksum, sizeof(checksum)); free(checklist); free(checklist_sorted); - if ( read_failures ) + if ( !silent && read_failures ) warnx("WARNING: %zu listed %s could not be read", read_failures, read_failures == 1 ? "file" : "files"); - if ( check_failures ) + if ( !silent && check_failures ) warnx("WARNING: %zu computed %s did NOT match", check_failures, check_failures == 1 ? "checksum" : "checksums"); return read_failures ? 1 : check_failures ? 2 : 0;