Fold send_all() wrapper unix_write() into one function
PATCH 1/1 Fold send_all() wrapper unix_write() into one function
From: Jes Sorensen <[email protected]>
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 <[email protected]>
--- qemu-char.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
qemu-char.c +2 -6
@@ -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
Signature · 1 line
1.7.2.3
Anthony Liguori
AppliedQuoted 7 lines · On 11/01/2010 02:02 PM, [email protected] wrote:
From: Jes Sorensen<[email protected]>
The current
send_all()wrapper for POSIX calls does nothing but callunix_write(). Merge them to simplify the code.Signed-off-by Jes Sorensen<[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 33 lines
--- qemu-char.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)qemu-char.c +2
-6@@ -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