mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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: Ryota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
b6353bea57
commit
06b611c48e
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue