From b37bab9abcaed4bec5ce808f3bb98d84164b66c6 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 29 Dec 2015 19:07:43 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/daemon.c | 5 +++-- src/daemon.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/daemon.c b/src/daemon.c index 71e0226..d99b74a 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -42,7 +42,6 @@ extern char **environ; * @param FUN `pread` or `pwrite`. */ #define PIO(FUN) \ - char *buffer = buf; \ ssize_t r, n = 0; \ int saved_errno = 0; \ sigset_t mask, oldmask; \ @@ -79,6 +78,7 @@ fail: \ ssize_t preadn(int fildes, void *buf, size_t nbyte, size_t offset) { + char *buffer = buf; PIO(pread); } @@ -93,8 +93,9 @@ preadn(int fildes, void *buf, size_t nbyte, size_t offset) * @return See pwrite(3). */ ssize_t -pwriten(int fildes, void *buf, size_t nbyte, size_t offset) +pwriten(int fildes, const void *buf, size_t nbyte, size_t offset) { + const char *buffer = buf; PIO(pwrite); } diff --git a/src/daemon.h b/src/daemon.h index e2a3f40..7567a74 100644 --- a/src/daemon.h +++ b/src/daemon.h @@ -167,7 +167,7 @@ ssize_t preadn(int fildes, void *buf, size_t nbyte, size_t offset); * @param offset See pwrite(3). * @return See pwrite(3). */ -ssize_t pwriten(int fildes, void *buf, size_t nbyte, size_t offset); +ssize_t pwriten(int fildes, const void *buf, size_t nbyte, size_t offset); /** * Wrapper for `read` that reads all available data. -- cgit v1.2.3-70-g09d2