9
0
Fork 0

crc: Do not lseek if not necessary (bb devs do not allow lseek)

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2009-12-09 16:59:23 +01:00
parent 1dc345ccf2
commit 21b96abb7c
1 changed files with 6 additions and 4 deletions

View File

@ -67,10 +67,12 @@ static int do_crc (cmd_tbl_t *cmdtp, int argc, char *argv[])
return 1;
}
if (lseek(fd, start, SEEK_SET) == -1) {
perror("lseek");
err = 1;
goto out;
if (start > 0) {
if (lseek(fd, start, SEEK_SET) == -1) {
perror("lseek");
err = 1;
goto out;
}
}
buf = xmalloc(4096);