Don't call close() for not associated file handle

This commit is contained in:
Stas Degteff 2011-02-22 11:37:07 +00:00
parent 177bd5183a
commit 84640ac97a

View File

@ -213,7 +213,11 @@ int gfile::Open(const char* __path, int __access, const char* __fmode, int __shf
int gfile::Close() int gfile::Close()
{ {
if (fp) return Fclose(); if (fp) return Fclose();
if (fh==-1)
{
status = 0;
return 0;
}
int _ret = g_close(fh); int _ret = g_close(fh);
status = _ret ? errno : 0; status = _ret ? errno : 0;
fh = -1; fh = -1;