summaryrefslogtreecommitdiffstats
path: root/crypto/digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/digest.c')
-rw-r--r--crypto/digest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/digest.c b/crypto/digest.c
index 493e56902d..230db26e84 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -226,9 +226,9 @@ static int digest_update_from_fd(struct digest *d, int fd,
unsigned char *buf = xmalloc(PAGE_SIZE);
int ret = 0;
- ret = lseek(fd, start, SEEK_SET);
- if (ret == -1) {
+ if (lseek(fd, start, SEEK_SET) != start) {
perror("lseek");
+ ret = -errno;
goto out_free;
}