[PATCH] libfile: Make write_file buffer const

Sascha Hauer s.hauer at pengutronix.de
Tue Jan 30 23:58:55 PST 2018


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/libfile.h | 2 +-
 lib/libfile.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/libfile.h b/include/libfile.h
index dd0b00f988..eb4311d0bc 100644
--- a/include/libfile.h
+++ b/include/libfile.h
@@ -11,7 +11,7 @@ void *read_file(const char *filename, size_t *size);
 int read_file_2(const char *filename, size_t *size, void **outbuf,
 		loff_t max_size);
 
-int write_file(const char *filename, void *buf, size_t size);
+int write_file(const char *filename, const void *buf, size_t size);
 
 int copy_file(const char *src, const char *dst, int verbose);
 
diff --git a/lib/libfile.c b/lib/libfile.c
index 6b70306dbd..1face96c82 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -230,7 +230,7 @@ EXPORT_SYMBOL(read_file);
  *
  * Return: 0 for success or negative error value
  */
-int write_file(const char *filename, void *buf, size_t size)
+int write_file(const char *filename, const void *buf, size_t size)
 {
 	int fd, ret;
 
-- 
2.15.1




More information about the barebox mailing list