qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] Fold send_all() wrapper unix_write() into one function
@ 2010-10-15 14:41 Jes.Sorensen
  0 siblings, 0 replies; 3+ messages in thread
From: Jes.Sorensen @ 2010-10-15 14:41 UTC (permalink / raw)
  To: qemu-devel

From: Jes Sorensen <Jes.Sorensen@redhat.com>

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>
---
 qemu-char.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 6d2dce7..88997f9 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
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 1/1] Fold send_all() wrapper unix_write() into one function
@ 2010-11-01 19:02 Jes.Sorensen
  2010-11-03 18:27 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Jes.Sorensen @ 2010-11-01 19:02 UTC (permalink / raw)
  To: qemu-devel

From: Jes Sorensen <Jes.Sorensen@redhat.com>

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>
---
 qemu-char.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 6d2dce7..88997f9 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
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-03 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 14:41 [Qemu-devel] [PATCH 1/1] Fold send_all() wrapper unix_write() into one function Jes.Sorensen
  -- strict thread matches above, loose matches on Subject: below --
2010-11-01 19:02 Jes.Sorensen
2010-11-03 18:27 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).