block: Save errno before error_setg_errno
commit17826bc159893300a05551d8a830275c5ecf0092
authorMax Reitz <mreitz@redhat.com>
Tue, 5 Nov 2013 19:03:33 +0000 (5 20:03 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 7 Nov 2013 12:58:58 +0000 (7 13:58 +0100)
tree9796d997c2fa6a5b5e21a71c252178bb38628e40
parent43cd209803d6cffb1e1a028c9ff2fd0ff4fce954
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>
block.c