diff --git a/libsrc/common/fdopen.c b/libsrc/common/fdopen.c index 6f0ea365a..cfd649d75 100644 --- a/libsrc/common/fdopen.c +++ b/libsrc/common/fdopen.c @@ -26,8 +26,7 @@ FILE* __fastcall__ fdopen (int handle, const char* /*mode*/) /* Find a free file slot */ if (!(f = _fdesc ())) { /* No slots */ - _errno = EMFILE; /* Too many files */ - return 0; + return (FILE*) _seterrno (EMFILE); /* Too many files */ } /* Insert the handle, and return the descriptor */