[win32] use the correct value for an invalid handle and check results. Remove trailing spaces

SVN revision: 33579
This commit is contained in:
doursse 2008-01-24 08:41:23 +00:00 committed by doursse
parent ebdbf7c6ec
commit 0f79f11a02
1 changed files with 34 additions and 33 deletions

View File

@ -749,10 +749,11 @@ eet_open(const char *file, Eet_File_Mode mode)
fcntl(fileno(ef->fp), F_SETFD, FD_CLOEXEC);
#else
/* FIXME: check if that code is needed / correct */
h = (HANDLE) _get_osfhandle (fileno(ef->fp));
if (h == (HANDLE) -1)
h = (HANDLE) _get_osfhandle(fileno(ef->fp));
if (h == INVALID_HANDLE_VALUE)
return NULL;
if (!SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0))
return NULL;
SetHandleInformation (h, HANDLE_FLAG_INHERIT, 0);
#endif
/* if we opened for read or read-write */
if ((mode == EET_FILE_MODE_READ) || (mode == EET_FILE_MODE_READ_WRITE))