]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[digest] Treat inability to acquire an image as a fatal error
authorMichael Brown <mcb30@ipxe.org>
Wed, 6 Aug 2025 13:54:30 +0000 (14:54 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 6 Aug 2025 14:21:14 +0000 (15:21 +0100)
The "md5sum" and "sha1sum" commands were originally intended solely as
debugging utilities, and would return success (with a warning message)
even if the specified images did not exist.

To minimise surprise and to be consistent with other commands, treat
the inability to acquire an image as a fatal error.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/hci/commands/digest_cmd.c

index 47a7339f119a56f18e0e267e0c74a135fc6633f3..20d33a5d808b37d2ceb8e53430958b8a31f8f9c1 100644 (file)
@@ -86,7 +86,7 @@ int digest_exec ( int argc, char **argv, struct digest_algorithm *digest ) {
 
                /* Acquire image */
                if ( ( rc = imgacquire ( argv[i], 0, &image ) ) != 0 )
-                       continue;
+                       return rc;
 
                /* Calculate digest */
                digest_init ( digest, ctx );