int fd;
#if defined(WIN32) && defined(UNICODE)
const wchar_t * aPath = Kernel_Utils::utf8_decode(thePath);
- if (!(fd = _wopen(aPath, O_RDONLY))) return false;
+ fd = _wopen(aPath, O_RDONLY);
+ if (fd == -1) return false;
#else
if(!(fd = open(thePath, O_RDONLY))) return false;
#endif