diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-06-11 01:04:36 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-06-11 01:04:36 +0200 |
commit | b45eead4dfd6e820b4c1634ae72398bf717193f9 (patch) | |
tree | 9d0e40ed79e7a597c8fddc56c58cfb79038e8f60 | |
parent | 2c661f100fbe6c13e7aaef2ea3c9bef546246bb2 (diff) |
cleanup: mark input pointer on write_retry as const
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | include/util.h | 2 | ||||
-rw-r--r-- | lib/util/write_retry.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/util.h b/include/util.h index b496039..8e54cb4 100644 --- a/include/util.h +++ b/include/util.h @@ -17,7 +17,7 @@ int canonicalize_name(char *filename); A wrapper around the write() system call. It retries the write if it is interrupted by a signal or only part of the data was written. */ -ssize_t write_retry(int fd, void *data, size_t size); +ssize_t write_retry(int fd, const void *data, size_t size); /* A wrapper around the read() system call. It retries the read if it is diff --git a/lib/util/write_retry.c b/lib/util/write_retry.c index 637b5d2..0ef856c 100644 --- a/lib/util/write_retry.c +++ b/lib/util/write_retry.c @@ -4,7 +4,7 @@ #include "util.h" -ssize_t write_retry(int fd, void *data, size_t size) +ssize_t write_retry(int fd, const void *data, size_t size) { ssize_t ret, total = 0; @@ -18,7 +18,7 @@ ssize_t write_retry(int fd, void *data, size_t size) return -1; } - data = (char *)data + ret; + data = (const char *)data + ret; size -= ret; total += ret; } |