diff options
Diffstat (limited to 'src/jtag/parport.c')
-rw-r--r-- | src/jtag/parport.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/jtag/parport.c b/src/jtag/parport.c index e56d65c6..e9934974 100644 --- a/src/jtag/parport.c +++ b/src/jtag/parport.c @@ -276,26 +276,26 @@ int parport_register_commands(struct command_context_s *cmd_ctx) #if PARPORT_USE_GIVEIO == 1 int parport_get_giveio_access() { - HANDLE h; - OSVERSIONINFO version; - - version.dwOSVersionInfoSize = sizeof version; - if (!GetVersionEx( &version )) { - errno = EINVAL; - return -1; - } - if (version.dwPlatformId != VER_PLATFORM_WIN32_NT) - return 0; - - h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); - if (h == INVALID_HANDLE_VALUE) { - errno = ENODEV; - return -1; - } - - CloseHandle( h ); - - return 0; + HANDLE h; + OSVERSIONINFO version; + + version.dwOSVersionInfoSize = sizeof version; + if (!GetVersionEx( &version )) { + errno = EINVAL; + return -1; + } + if (version.dwPlatformId != VER_PLATFORM_WIN32_NT) + return 0; + + h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); + if (h == INVALID_HANDLE_VALUE) { + errno = ENODEV; + return -1; + } + + CloseHandle( h ); + + return 0; } #endif |