diff options
| author | Max Reitz <mreitz@redhat.com> | 2015-02-25 13:08:16 -0500 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-03-18 12:05:38 +0100 |
| commit | 2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc (patch) | |
| tree | f1e037533c7f2aefae8d8b3a06412b214a7757ce | |
| parent | 453b07b13443713f6a632005977c7ccab17e135d (diff) | |
| download | focaccia-qemu-2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc.tar.gz focaccia-qemu-2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc.zip | |
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>
| -rw-r--r-- | block/nbd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c index 6634a69664..217618612d 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; |