summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-02-25 13:08:19 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2015-03-18 12:05:42 +0100
commit892f5a5270f9f3cae4f384dffbf70679fa2a57b6 (patch)
tree91dd7112e83872008f6a90158d80618fd3a6ce9e
parent2b1f13b996c3a278ed3d4bf4ce0893f3506fb7cc (diff)
downloadfocaccia-qemu-892f5a5270f9f3cae4f384dffbf70679fa2a57b6.tar.gz
focaccia-qemu-892f5a5270f9f3cae4f384dffbf70679fa2a57b6.zip
nbd: Pass return value from nbd_handle_list()
While it does not make a difference in practice, nbd_receive_options()
generally returns -errno, so it should do that here as well; and the
easiest way to achieve this is by passing on the value returned by
nbd_handle_list().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-7-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--nbd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nbd.c b/nbd.c
index 02ba0fe252..34f4dbb80d 100644
--- a/nbd.c
+++ b/nbd.c
@@ -351,7 +351,7 @@ fail:
 static int nbd_receive_options(NBDClient *client)
 {
     while (1) {
-        int csock = client->sock;
+        int csock = client->sock, ret;
         uint32_t tmp, length;
         uint64_t magic;
 
@@ -398,8 +398,9 @@ static int nbd_receive_options(NBDClient *client)
         TRACE("Checking option");
         switch (be32_to_cpu(tmp)) {
         case NBD_OPT_LIST:
-            if (nbd_handle_list(client, length) < 0) {
-                return 1;
+            ret = nbd_handle_list(client, length);
+            if (ret < 0) {
+                return ret;
             }
             break;