osdep/io: fix error check

_get_osfhandle returns INVALID_HANDLE_VALUE on failure, not 0.
This commit is contained in:
NRK authored and sfan5 committed 2026-03-12 15:58:53 +01:00
1 parent ad9374d03e
commit a2ddcdf67b
1 file changed
+1 -1
+1 -1
View File
@@ -815,7 +815,7 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
mp_assert(flags == MAP_SHARED); // not implemented
HANDLE osf = (HANDLE)_get_osfhandle(fd);
if (!osf) {
if (osf == INVALID_HANDLE_VALUE) {
errno = EBADF;
return MAP_FAILED;
}