]> git.proxmox.com Git - qemu.git/commitdiff
Fold send_all() wrapper unix_write() into one function
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 1 Nov 2010 19:02:23 +0000 (20:02 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 3 Nov 2010 17:48:09 +0000 (12:48 -0500)
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 <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char.c

index 6d2dce7a9b42760ebb8819becd1e25b2ac9303ea..88997f9d5aa1086d2b6a052b9ff2e3f6d5ab4858 100644 (file)
@@ -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