summaryrefslogtreecommitdiff
path: root/migration/tcp.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-03-07 20:36:03 +0000
committerDaniel P. Berrange <berrange@redhat.com>2016-03-10 17:19:34 +0000
commitb16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68 (patch)
tree894551b8e7841e2fddfd790c204b7ef453d6f2eb /migration/tcp.c
parenta2d96af4bb267bd1844f71f593d07273c7fc134c (diff)
downloadqemu-b16a44e13e89ee397a3d9a9e3cfa1605c3c1dc68.tar.gz
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 'migration/tcp.c')
-rw-r--r--migration/tcp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/migration/tcp.c b/migration/tcp.c
index e888a4e490..e1fa7f8f18 100644
--- a/migration/tcp.c
+++ b/migration/tcp.c
@@ -59,12 +59,11 @@ static void tcp_accept_incoming_migration(void *opaque)
socklen_t addrlen = sizeof(addr);
int s = (intptr_t)opaque;
QEMUFile *f;
- int c, err;
+ int c;
do {
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);
- err = socket_error();
- } while (c < 0 && err == EINTR);
+ } while (c < 0 && errno == EINTR);
qemu_set_fd_handler(s, NULL, NULL, NULL);
closesocket(s);
@@ -72,7 +71,7 @@ static void tcp_accept_incoming_migration(void *opaque)
if (c < 0) {
error_report("could not accept migration connection (%s)",
- strerror(err));
+ strerror(errno));
return;
}