diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-03-07 20:36:03 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2016-03-10 17:19:34 +0000 |
commit | b16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68 (patch) | |
tree | 894551b8e7841e2fddfd790c204b7ef453d6f2eb /block/sheepdog.c | |
parent | a2d96af4bb267bd1844f71f593d07273c7fc134c (diff) |
osdep: remove use of socket_error() from all code
Now that QEMU wraps the Win32 sockets methods to automatically
set errno upon failure, there is no reason for callers to use
the socket_error() method. They can rely on accessing errno
even on Win32. Remove all use of socket_error() from general
code, leaving it as a static method in oslib-win32.c only.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r-- | block/sheepdog.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c index 8739accddd..05677ed983 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -615,14 +615,13 @@ static coroutine_fn int send_co_req(int sockfd, SheepdogReq *hdr, void *data, ret = qemu_co_send(sockfd, hdr, sizeof(*hdr)); if (ret != sizeof(*hdr)) { error_report("failed to send a req, %s", strerror(errno)); - ret = -socket_error(); - return ret; + return -errno; } ret = qemu_co_send(sockfd, data, *wlen); if (ret != *wlen) { - ret = -socket_error(); error_report("failed to send a req, %s", strerror(errno)); + return -errno; } return ret; |