From c3922228a989cf93e3b7a2a7c5099d8f0e15ea5c Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 3 Jun 2010 20:18:43 +0000 Subject: [PATCH] Use _seterrno to make the code shorter. git-svn-id: svn://svn.cc65.org/cc65/trunk@4688 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/fdopen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 */ -- 2.39.5