aboutsummaryrefslogtreecommitdiff
path: root/qga/channel-win32.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-02-28 11:07:25 +0100
committerMarkus Armbruster <armbru@redhat.com>2020-03-09 13:36:15 +0100
commit672db77892d367f1dc3797571511acce27597a11 (patch)
tree05ffa465723e65bd11a7ad462b36b8e305317e2f /qga/channel-win32.c
parentcf0c76cd6d6fc2f6e62160cd209bd0ed622bb83c (diff)
qga: Improve error report by calling error_setg_win32()
Use error_setg_win32() which adds a hint similar to strerror(errno)). Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200228100726.8414-4-philmd@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qga/channel-win32.c')
-rw-r--r--qga/channel-win32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qga/channel-win32.c b/qga/channel-win32.c
index c86f4388db..99648c95b6 100644
--- a/qga/channel-win32.c
+++ b/qga/channel-win32.c
@@ -308,7 +308,8 @@ static gboolean ga_channel_open(GAChannel *c, GAChannelMethod method,
}
if (method == GA_CHANNEL_ISA_SERIAL && !SetCommTimeouts(c->handle,&comTimeOut)) {
- g_critical("error setting timeout for com port: %lu",GetLastError());
+ g_autofree gchar *emsg = g_win32_error_message(GetLastError());
+ g_critical("error setting timeout for com port: %s", emsg);
CloseHandle(c->handle);
return false;
}