diff --git a/commands/crc.c b/commands/crc.c index 09af6aa..8f80e42 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -47,9 +47,12 @@ } if (start > 0) { - ret = lseek(fd, start, SEEK_SET); - if (ret == -1) { + off_t lseek_ret; + errno = 0; + lseek_ret = lseek(fd, start, SEEK_SET); + if (lseek_ret == (off_t)-1 && errno) { perror("lseek"); + ret = -1; goto out; } }