]> git.baikalelectronics.ru Git - uboot.git/commit
tools: kwboot: Replace fstat()+st_size by lseek()+SEEK_END
authorPali Rohár <pali@kernel.org>
Wed, 6 Apr 2022 13:18:59 +0000 (15:18 +0200)
committerStefan Roese <sr@denx.de>
Thu, 21 Apr 2022 10:31:36 +0000 (12:31 +0200)
commit245c0593332b4d99b5d28ea7979055b48a91eae8
treeb4e2f9f48953490264cb5c32a92dd7eda2b89918
parent7201cfd3d8a7524fc9edd3c1785d06757211de6f
tools: kwboot: Replace fstat()+st_size by lseek()+SEEK_END

fstat()'s st_size works only for regular files. lseek() with SEEK_END works
also for block or MTD devices. This replacement allows kwboot to load
kwbimage from /dev/mtd0 for booting another device over /dev/ttyS0.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
tools/kwboot.c