Skip to content

Commit 6bbb939

Browse files
XanClicmdroth
authored andcommitted
block/raw-posix: Fix ret in raw_open_common()
The return value must be negative on error; there is one place in raw_open_common() where errp is set, but ret remains 0. Fix it. Cc: [email protected] Signed-off-by: Max Reitz <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> (cherry picked from commit 01212d4) Signed-off-by: Michael Roth <[email protected]>
1 parent 178ed9a commit 6bbb939

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/raw-posix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
447447
s->has_write_zeroes = true;
448448

449449
if (fstat(s->fd, &st) < 0) {
450+
ret = -errno;
450451
error_setg_errno(errp, errno, "Could not stat file");
451452
goto fail;
452453
}

0 commit comments

Comments
 (0)