diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-02-08 09:04:27 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-02-08 09:04:27 +0100 |
commit | 0dce5375d799e727bd1aa5ccdb28156d9bcd4d17 (patch) | |
tree | e1c6dd036a69ab954616219dfa0cee8312bb43f8 /include | |
parent | 6f826bfe45298721a92bbe93d32a6a0eb76d46ee (diff) | |
parent | 74cdc34323ee23b9b195866c56699e268f05841a (diff) | |
download | barebox-0dce5375d799e727bd1aa5ccdb28156d9bcd4d17.tar.gz barebox-0dce5375d799e727bd1aa5ccdb28156d9bcd4d17.tar.xz |
Merge branch 'for-next/tftp-workaround'
Diffstat (limited to 'include')
-rw-r--r-- | include/fs.h | 22 | ||||
-rw-r--r-- | include/image.h | 1 | ||||
-rw-r--r-- | include/libfile.h | 4 | ||||
-rw-r--r-- | include/uimagefs.h | 2 |
4 files changed, 12 insertions, 17 deletions
diff --git a/include/fs.h b/include/fs.h index 3d88bfad4a..e6fcd044dd 100644 --- a/include/fs.h +++ b/include/fs.h @@ -101,24 +101,14 @@ struct fs_device_d { char *linux_rootarg; }; -/* - * Some filesystems i.e. tftpfs only support lseek into one direction. - * To detect this limited functionality we add this extra function. - * Additionaly we also return 0 if we even can not seek forward. - */ -static inline int can_lseek_backward(int fd) -{ - int ret; +bool __is_tftp_fs(const char *path); - ret = lseek(fd, 1, SEEK_SET); - if (ret < 0) - return 0; - - ret = lseek(fd, 0, SEEK_SET); - if (ret < 0) - return 0; +static inline bool is_tftp_fs(const char *path) +{ + if (!IS_ENABLED(CONFIG_FS_TFTP)) + return false; - return 1; + return __is_tftp_fs(path); } #define drv_to_fs_driver(d) container_of(d, struct fs_driver_d, drv) diff --git a/include/image.h b/include/image.h index 3e75d49b88..add9c85874 100644 --- a/include/image.h +++ b/include/image.h @@ -246,6 +246,7 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr); struct uimage_handle { struct image_header header; char *name; + char *copy; struct uimage_handle_data ihd[MAX_MULTI_IMAGE_COUNT]; int nb_data_entries; size_t data_offset; diff --git a/include/libfile.h b/include/libfile.h index eb4311d0bc..fd2fadeaa8 100644 --- a/include/libfile.h +++ b/include/libfile.h @@ -26,4 +26,8 @@ int make_directory(const char *pathname); int unlink_recursive(const char *path, char **failedpath); +char *make_temp(const char *template); + +int cache_file(const char *path, char **newpath); + #endif /* __LIBFILE_H */ diff --git a/include/uimagefs.h b/include/uimagefs.h index 81b32310ad..3f58589b73 100644 --- a/include/uimagefs.h +++ b/include/uimagefs.h @@ -45,7 +45,7 @@ struct uimagefs_handle { struct image_header header; int nb_data_entries; char *filename; - char *tmp; + char *copy; struct list_head list; }; |