diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-12-09 16:59:23 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-12-10 12:15:02 +0100 |
commit | 21b96abb7c25db79ac7bf29046a0766819128cb3 (patch) | |
tree | e4030942cd42a37c2b51bf476a8e2e8748102980 | |
parent | 1dc345ccf293331fc6a521e1cb25d4d709b65a93 (diff) | |
download | barebox-21b96abb7c25db79ac7bf29046a0766819128cb3.tar.gz barebox-21b96abb7c25db79ac7bf29046a0766819128cb3.tar.xz |
crc: Do not lseek if not necessary (bb devs do not allow lseek)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | commands/crc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/commands/crc.c b/commands/crc.c index 6983c9d090..b2dbfc78cc 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -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); |