From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO68y-00028M-Fd for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO68u-0004JT-A5 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:07:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO68u-0004JG-47 for qemu-devel@nongnu.org; Tue, 26 Jan 2016 11:06:56 -0500 From: "Daniel P. Berrange" Date: Tue, 26 Jan 2016 16:06:49 +0000 Message-Id: <1453824409-10743-1-git-send-email-berrange@redhat.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH] char: make io_channel_send be used unconditionally List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell The io_channel_send_full() method was used unconditionally, but the io_channel_send() method was only used from !_WIN32 code paths. Some versions of Mingw toolchain will complain about the method being defined but not used as a result. The io_channel_send() API doesn't really simplify life very much, so get rid of it and rename io_channel_send_full() to just be io_channel_send(). Signed-off-by: Daniel P. Berrange --- qemu-char.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 7ded3c2..4c3daa6 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -887,9 +887,9 @@ static void remove_fd_in_watch(CharDriverState *chr) } -static int io_channel_send_full(QIOChannel *ioc, - const void *buf, size_t len, - int *fds, size_t nfds) +static int io_channel_send(QIOChannel *ioc, + const void *buf, size_t len, + int *fds, size_t nfds) { size_t offset = 0; @@ -920,11 +920,6 @@ static int io_channel_send_full(QIOChannel *ioc, } -static int io_channel_send(QIOChannel *ioc, const void *buf, size_t len) -{ - return io_channel_send_full(ioc, buf, len, NULL, 0); -} - #ifndef _WIN32 typedef struct FDCharDriver { @@ -938,7 +933,7 @@ static int fd_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { FDCharDriver *s = chr->opaque; - return io_channel_send(s->ioc_out, buf, len); + return io_channel_send(s->ioc_out, buf, len, NULL, 0); } static gboolean fd_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque) @@ -1257,7 +1252,7 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len) return 0; } } - return io_channel_send(s->ioc, buf, len); + return io_channel_send(s->ioc, buf, len, NULL, 0); } static GSource *pty_chr_add_watch(CharDriverState *chr, GIOCondition cond) @@ -2589,9 +2584,9 @@ static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { TCPCharDriver *s = chr->opaque; if (s->connected) { - int ret = io_channel_send_full(s->ioc, buf, len, - s->write_msgfds, - s->write_msgfds_num); + int ret = io_channel_send(s->ioc, buf, len, + s->write_msgfds, + s->write_msgfds_num); /* free the written msgfds, no matter what */ if (s->write_msgfds_num) { -- 2.5.0