Skip to content
Snippets Groups Projects
Commit cf0c76cd authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Markus Armbruster
Browse files

util/osdep: Improve error report by calling error_setg_win32()


Use error_setg_win32() which adds a hint similar to strerror(errno)).

Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200228100726.8414-3-philmd@redhat.com>
Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
parent 4c235193
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment