]> wimlib.net Git - wimlib/blobdiff - src/sha1.c
Various minor changes and fixes.
[wimlib] / src / sha1.c
index b65d25d6c57c1a31f8912664c9b64de1fbb3a020..7fd67bce992c86006dc9f05eaf56a6236293dfdc 100644 (file)
@@ -245,10 +245,15 @@ int sha1sum(const char *filename, void *md)
 
        fp = fopen(filename, "rb");
        if (!fp) {
-               ERROR("Cannot open the file `%s' for reading: %m\n", filename);
+               ERROR_WITH_ERRNO("Cannot open the file `%s' for reading",
+                                filename);
                return WIMLIB_ERR_OPEN;
        }
        ret = sha1_stream(fp, md);
+       if (ret != 0) {
+               ERROR_WITH_ERRNO("Error calculating SHA1 message digest of "
+                                "`%s'", filename);
+       }
        fclose(fp);
        return ret;
 }