diff --git a/crypto/digest.c b/crypto/digest.c index 493e569..230db26 100644 --- a/crypto/digest.c +++ b/crypto/digest.c @@ -226,9 +226,9 @@ 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; }