From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQgOC-0002Dg-O4 for qemu-devel@nongnu.org; Wed, 25 Feb 2015 13:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQgOB-0001eU-U2 for qemu-devel@nongnu.org; Wed, 25 Feb 2015 13:08:52 -0500 From: Max Reitz Date: Wed, 25 Feb 2015 13:08:19 -0500 Message-Id: <1424887718-10800-7-git-send-email-mreitz@redhat.com> In-Reply-To: <1424887718-10800-1-git-send-email-mreitz@redhat.com> References: <1424887718-10800-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 06/25] nbd: Pass return value from nbd_handle_list() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz 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 --- nbd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nbd.c b/nbd.c index d2eb1c5..77d1158 100644 --- a/nbd.c +++ b/nbd.c @@ -352,7 +352,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; @@ -399,8 +399,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; -- 2.1.0