]> Git Repo - qemu.git/commitdiff
qemu-nbd: Fix return value handling of bdrv_open
authorRyota Ozaki <[email protected]>
Sat, 20 Mar 2010 06:23:22 +0000 (15:23 +0900)
committerAurelien Jarno <[email protected]>
Sat, 27 Mar 2010 12:56:17 +0000 (13:56 +0100)
bdrv_open may return -errno so we have to check
if the return value is '< 0', not '== -1'.

Signed-off-by: Ryota Ozaki <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
qemu-nbd.c

index a393583040a04ea9d03f18e3c84292157e47d8fc..b89c36101e20f0be354b0a723541cb2e20c59c34 100644 (file)
@@ -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;
This page took 0.024093 seconds and 4 git commands to generate.