Skip to content

Commit

Permalink
Fix error reporting under Win32 (CreateFile does not set errno)
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4698 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
malc committed Jun 8, 2008
1 parent 0e67458 commit 7fb2a86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kqemu.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,19 @@ int kqemu_init(CPUState *env)
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
if (kqemu_fd == KQEMU_INVALID_FD) {
fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %lu\n",
KQEMU_DEVICE, GetLastError());
return -1;
}
#else
kqemu_fd = open(KQEMU_DEVICE, O_RDWR);
#endif
if (kqemu_fd == KQEMU_INVALID_FD) {
fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %s\n",
KQEMU_DEVICE, strerror(errno));
return -1;
}
#endif
version = 0;
#ifdef _WIN32
DeviceIoControl(kqemu_fd, KQEMU_GET_VERSION, NULL, 0,
Expand Down

0 comments on commit 7fb2a86

Please sign in to comment.