From 5fc9cfedfa09199e10b5f9b67dcd286bfeae4f7a Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Mon, 1 Nov 2010 20:02:23 +0100 Subject: [PATCH] Fold send_all() wrapper unix_write() into one function The current send_all() wrapper for POSIX calls does nothing but call unix_write(). Merge them to simplify the code. Signed-off-by: Jes Sorensen Signed-off-by: Anthony Liguori --- qemu-char.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 6d2dce7a9b..88997f9d5a 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -508,9 +508,10 @@ int send_all(int fd, const void *buf, int len1) #else -static int unix_write(int fd, const uint8_t *buf, int len1) +int send_all(int fd, const void *_buf, int len1) { int ret, len; + const uint8_t *buf = _buf; len = len1; while (len > 0) { @@ -527,11 +528,6 @@ static int unix_write(int fd, const uint8_t *buf, int len1) } return len1 - len; } - -int send_all(int fd, const void *buf, int len1) -{ - return unix_write(fd, buf, len1); -} #endif /* !_WIN32 */ #ifndef _WIN32