From 680c36934e5c2c5329a8581542ab65422aa9444c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 26 Jun 2014 03:10:25 +0200 Subject: [PATCH] Fix compile warnings --- qrexec-lib/libqrexec-utils.h | 2 +- qrexec-lib/txrx-vchan.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qrexec-lib/libqrexec-utils.h b/qrexec-lib/libqrexec-utils.h index 9b03caf..8e7680c 100644 --- a/qrexec-lib/libqrexec-utils.h +++ b/qrexec-lib/libqrexec-utils.h @@ -43,7 +43,7 @@ void do_fork_exec(const char *cmdline, int *pid, int *stdin_fd, int *stdout_fd, int *stderr_fd); void wait_for_vchan_or_argfd(libvchan_t *vchan, int max, fd_set * rdset, fd_set * wrset); int read_vchan_all(libvchan_t *vchan, void *data, size_t size); -int write_vchan_all(libvchan_t *vchan, void *data, size_t size); +int write_vchan_all(libvchan_t *vchan, const void *data, size_t size); int read_all(int fd, void *buf, int size); int write_all(int fd, const void *buf, int size); void fix_fds(int fdin, int fdout, int fderr); diff --git a/qrexec-lib/txrx-vchan.c b/qrexec-lib/txrx-vchan.c index c552b84..fc6f774 100644 --- a/qrexec-lib/txrx-vchan.c +++ b/qrexec-lib/txrx-vchan.c @@ -75,8 +75,9 @@ void wait_for_vchan_or_argfd(libvchan_t *ctrl, int max, fd_set * rdset, fd_set * while (wait_for_vchan_or_argfd_once(ctrl, max, rdset, wrset) == 0); } -int write_vchan_all(libvchan_t *vchan, void *data, size_t size) { - int pos, ret; +int write_vchan_all(libvchan_t *vchan, const void *data, size_t size) { + size_t pos; + int ret; pos = 0; while (pos < size) { @@ -89,7 +90,8 @@ int write_vchan_all(libvchan_t *vchan, void *data, size_t size) { } int read_vchan_all(libvchan_t *vchan, void *data, size_t size) { - int pos, ret; + size_t pos; + int ret; pos = 0; while (pos < size) {