aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-win.c
diff options
context:
space:
mode:
Diffstat (limited to 'chardev/char-win.c')
-rw-r--r--chardev/char-win.c2
1 files changed, 1 insertions, 1 deletions
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;
}