From 06b611c48edb1bf0301c3e7fe49dec2b9feaaf89 Mon Sep 17 00:00:00 2001 From: Ryota Ozaki Date: Sat, 20 Mar 2010 16:08:38 +0900 Subject: [PATCH] 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 Signed-off-by: Aurelien Jarno --- qemu-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-io.c b/qemu-io.c index b2f2f5a9a97..2f195bfe4fe 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -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; -- 2.39.5