Fixing logic error in winapi call error check of syscall.