summaryrefslogtreecommitdiffstats
path: root/common/uimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/uimage.c')
-rw-r--r--common/uimage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/uimage.c b/common/uimage.c
index 28a25bba2d..b6f0f109ca 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -111,9 +111,9 @@ again:
/*
* Hack around tftp fs. We need lseek for uImage support, but
* this cannot be implemented in tftp fs, so we detect this
- * by doing a test lseek and copy the file to ram if it fails
+ * and copy the file to ram if it fails
*/
- if (IS_BUILTIN(CONFIG_FS_TFTP) && lseek(fd, 0, SEEK_SET)) {
+ if (IS_BUILTIN(CONFIG_FS_TFTP) && !can_lseek_backward(fd)) {
close(fd);
ret = copy_file(filename, uimage_tmp, 0);
if (ret)