From 4c235193a2132a1d8e9bd78a21d90153c1f662ff Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Fri, 28 Feb 2020 11:07:23 +0100 Subject: chardev: Improve error report by calling error_setg_win32() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use error_setg_win32() which adds a hint similar to strerror(errno)). Reviewed-by: Daniel P. Berrangé Reviewed-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200228100726.8414-2-philmd@redhat.com> Signed-off-by: Markus Armbruster --- chardev/char-win.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chardev/char-win.c') diff --git a/chardev/char-win.c b/chardev/char-win.c index 34825f683d..d4fb44c4dc 100644 --- a/chardev/char-win.c +++ b/chardev/char-win.c @@ -96,7 +96,7 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp) s->file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); if (s->file == INVALID_HANDLE_VALUE) { - error_setg(errp, "Failed CreateFile (%lu)", GetLastError()); + error_setg_win32(errp, GetLastError(), "Failed CreateFile"); s->file = NULL; goto fail; } -- cgit 1.4.1