aboutsummaryrefslogtreecommitdiff
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorRyota Ozaki <ozaki.ryota@gmail.com>2010-03-20 15:23:22 +0900
committerAurelien Jarno <aurelien@aurel32.net>2010-03-27 13:56:17 +0100
commita16c174c51e7cd896c701d5d0e8329e610e90ce1 (patch)
tree2ca6b0d68c10a634e668cce178d3317207029f1e /qemu-nbd.c
parentbd12ff9df78b0d04059a35c4a9d0a9337eb4999e (diff)
downloadqemu-a16c174c51e7cd896c701d5d0e8329e610e90ce1.zip
qemu-a16c174c51e7cd896c701d5d0e8329e610e90ce1.tar.gz
qemu-a16c174c51e7cd896c701d5d0e8329e610e90ce1.tar.bz2
qemu-nbd: Fix return value handling of bdrv_open
bdrv_open may return -errno so we have to check if the return value is '< 0', not '== -1'. Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c2
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;