diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-08 01:55:09 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-08 01:55:09 +0000 |
commit | 7fb2a862f40a9615f8ae5bc3f8c0c2d33ee8db91 (patch) | |
tree | fbf00886850c0170eeb1b3dd2cb0ef7b6b924982 /kqemu.c | |
parent | 0e6745890ccfaaf1cfb591d3ad230a99a4e3c660 (diff) | |
download | qemu-7fb2a862f40a9615f8ae5bc3f8c0c2d33ee8db91.zip qemu-7fb2a862f40a9615f8ae5bc3f8c0c2d33ee8db91.tar.gz qemu-7fb2a862f40a9615f8ae5bc3f8c0c2d33ee8db91.tar.bz2 |
Fix error reporting under Win32 (CreateFile does not set errno)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4698 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'kqemu.c')
-rw-r--r-- | kqemu.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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, |