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

qemu-io: 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>
上级 b6353bea
......@@ -1284,7 +1284,7 @@ static int openfile(char *name, int flags, int growable)
flags |= BDRV_O_FILE;
}
if (bdrv_open(bs, name, flags) == -1) {
if (bdrv_open(bs, name, flags) < 0) {
fprintf(stderr, "%s: can't open device %s\n", progname, name);
bs = NULL;
return 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册