summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2016-07-06 10:19:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-08 08:59:31 +0200
commit3d33f178ccd7b0602b20c8fb37d7e57beed22e89 (patch)
tree2cef7aed55ff55e3e2084c03d29506f39d398b99
parent01cbfdfb3f131ba1c8e5286fce5e0c5d482dc569 (diff)
downloadbarebox-3d33f178ccd7b0602b20c8fb37d7e57beed22e89.tar.gz
libfile: Change write_full to be have const buf
write() uses a const pointer so write_full should do the same. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/libfile.h2
-rw-r--r--lib/libfile.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/libfile.h b/include/libfile.h
index de4f42d..dd0b00f 100644
--- a/include/libfile.h
+++ b/include/libfile.h
@@ -1,7 +1,7 @@
#ifndef __LIBFILE_H
#define __LIBFILE_H
-int write_full(int fd, void *buf, size_t size);
+int write_full(int fd, const void *buf, size_t size);
int read_full(int fd, void *buf, size_t size);
char *read_file_line(const char *fmt, ...);
diff --git a/lib/libfile.c b/lib/libfile.c
index 62e9b8e..cba2f02 100644
--- a/lib/libfile.c
+++ b/lib/libfile.c
@@ -28,7 +28,7 @@
* Like write, but guarantees to write the full buffer out, else
* it returns with an error.
*/
-int write_full(int fd, void *buf, size_t size)
+int write_full(int fd, const void *buf, size_t size)
{
size_t insize = size;
int now;