summaryrefslogtreecommitdiff
path: root/tools/fit_common.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-11-12 12:28:04 -0700
committerSimon Glass <sjg@chromium.org>2022-01-26 08:50:43 -0700
commite291a5c9a2acff16ba3b976198bba7da9828c9e9 (patch)
treec41e834a1be7d72454de82bcb7dc8dc8c7301609 /tools/fit_common.h
parent195f7893da9608931cfee63bc2f7a6aaa5169049 (diff)
tools: Move copyfile() into a common file
This function is useful in other places. Move it to a common file. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/fit_common.h')
-rw-r--r--tools/fit_common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/fit_common.h b/tools/fit_common.h
index 0e8ee79115f..872d8afa176 100644
--- a/tools/fit_common.h
+++ b/tools/fit_common.h
@@ -39,4 +39,15 @@ int mmap_fdt(const char *cmdname, const char *fname, size_t size_inc,
void **blobp, struct stat *sbuf, bool delete_on_error,
bool read_only);
+/**
+ * copyfile() - Copy a file
+ *
+ * This uses read()/write() to copy file @src to file @dst
+ *
+ * @src: Filename to read from
+ * @dst: Filename to write to
+ * @return 0 if OK, -1 on error
+ */
+int copyfile(const char *src, const char *dst);
+
#endif /* _FIT_COMMON_H_ */