summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-02-25 13:08:16 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2015-03-18 12:05:38 +0100
commit2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc (patch)
treef1e037533c7f2aefae8d8b3a06412b214a7757ce /block
parent453b07b13443713f6a632005977c7ccab17e135d (diff)
downloadhqemu-2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc.zip
hqemu-2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc.tar.gz
nbd: Fix nbd_establish_connection()'s return value
unix_connect_opts() and inet_connect_opts() do not necessarily set errno (if at all); therefore, nbd_establish_connection() should not literally return -errno on error. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-4-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 6634a69..2176186 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -248,7 +248,7 @@ static int nbd_establish_connection(BlockDriverState *bs, Error **errp)
/* Failed to establish connection */
if (sock < 0) {
logout("Failed to establish connection to NBD server\n");
- return -errno;
+ return -EIO;
}
return sock;
OpenPOWER on IntegriCloud