提交 a16c174c 编写于 作者: R Ryota Ozaki 提交者: Aurelien Jarno

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: NRyota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 bd12ff9d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册