diff options
author | Max Reitz <mreitz@redhat.com> | 2013-11-05 20:03:33 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-11-07 13:58:58 +0100 |
commit | 17826bc159893300a05551d8a830275c5ecf0092 (patch) | |
tree | 9796d997c2fa6a5b5e21a71c252178bb38628e40 | |
parent | 43cd209803d6cffb1e1a028c9ff2fd0ff4fce954 (diff) |
block: Save errno before error_setg_errno
error_setg_errno() may overwrite errno; therefore, its value should be
read before calling that function and not afterwards.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | block.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1084,8 +1084,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, snprintf(backing_filename, sizeof(backing_filename), "%s", filename); } else if (!realpath(filename, backing_filename)) { - error_setg_errno(errp, errno, "Could not resolve path '%s'", filename); ret = -errno; + error_setg_errno(errp, errno, "Could not resolve path '%s'", filename); goto fail; } |