diff options
author | Philippe Mathieu-Daudé | 2020-02-28 11:07:24 +0100 |
---|---|---|
committer | Markus Armbruster | 2020-03-09 13:36:15 +0100 |
commit | cf0c76cd6d6fc2f6e62160cd209bd0ed622bb83c (patch) | |
tree | 9b01c69bf0090c58eb255e1ebde901db80420df3 /util | |
parent | chardev: Improve error report by calling error_setg_win32() (diff) | |
download | qemu-cf0c76cd6d6fc2f6e62160cd209bd0ed622bb83c.tar.gz qemu-cf0c76cd6d6fc2f6e62160cd209bd0ed622bb83c.tar.xz qemu-cf0c76cd6d6fc2f6e62160cd209bd0ed622bb83c.zip |
util/osdep: Improve error report by calling error_setg_win32()
Use error_setg_win32() which adds a hint similar to strerror(errno)).
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200228100726.8414-3-philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/osdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/osdep.c b/util/osdep.c index f7d06050f7..4829c07ff6 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -82,8 +82,8 @@ static int qemu_mprotect__osdep(void *addr, size_t size, int prot) DWORD old_protect; if (!VirtualProtect(addr, size, prot, &old_protect)) { - error_report("%s: VirtualProtect failed with error code %ld", - __func__, GetLastError()); + g_autofree gchar *emsg = g_win32_error_message(GetLastError()); + error_report("%s: VirtualProtect failed: %s", __func__, emsg); return -1; } return 0; |