From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvVfu-0000Ui-QJ for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:03:38 -0400 Received: from [140.186.70.92] (port=42367 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvVft-0000Tw-Hm for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvVfr-0004Yd-TH for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:03:37 -0400 Received: from hall.aurel32.net ([88.191.82.174]:40749) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvVfr-0004YV-OP for qemu-devel@nongnu.org; Sat, 27 Mar 2010 09:03:35 -0400 Date: Sat, 27 Mar 2010 14:03:34 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 1/3] qemu-nbd: Fix return value handling of bdrv_open Message-ID: <20100327130334.GL15194@volta.aurel32.net> References: <1269066204-4376-1-git-send-email-ozaki.ryota@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1269066204-4376-1-git-send-email-ozaki.ryota@gmail.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ryota Ozaki Cc: qemu-devel@nongnu.org On Sat, Mar 20, 2010 at 03:23:22PM +0900, Ryota Ozaki wrote: > bdrv_open may return -errno so we have to check > if the return value is '< 0', not '== -1'. Thanks, applied. > Signed-off-by: Ryota Ozaki > --- > qemu-nbd.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/qemu-nbd.c b/qemu-nbd.c > index a393583..b89c361 100644 > --- a/qemu-nbd.c > +++ b/qemu-nbd.c > @@ -333,7 +333,7 @@ int main(int argc, char **argv) > if (bs == NULL) > return 1; > > - if (bdrv_open(bs, argv[optind], flags) == -1) > + if (bdrv_open(bs, argv[optind], flags) < 0) > return 1; > > fd_size = bs->total_sectors * 512; > -- > 1.6.5.2 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net