Don't call close() for not associated file handle
This commit is contained in:
parent
177bd5183a
commit
84640ac97a
@ -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;
|
||||||
|
Reference in New Issue
Block a user