mirror of
https://github.com/cc65/cc65.git
synced 2024-12-24 11:31:31 +00:00
Shortened the code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5701 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
cc5fd1dd72
commit
bfd0f58686
@ -21,18 +21,18 @@
|
|||||||
|
|
||||||
FILE* __fastcall__ fdopen (int handle, const char* /*mode*/)
|
FILE* __fastcall__ fdopen (int handle, const char* /*mode*/)
|
||||||
{
|
{
|
||||||
FILE* f;
|
register FILE* f;
|
||||||
|
|
||||||
/* Find a free file slot */
|
/* Find a free file slot */
|
||||||
if (!(f = _fdesc ())) {
|
if ((f = _fdesc ())) {
|
||||||
|
/* Insert the handle, and return the descriptor */
|
||||||
|
f->f_fd = handle;
|
||||||
|
f->f_flags = _FOPEN;
|
||||||
|
} else {
|
||||||
/* No slots */
|
/* No slots */
|
||||||
return (FILE*) _seterrno (EMFILE); /* Too many files */
|
_seterrno (EMFILE); /* Too many files */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert the handle, and return the descriptor */
|
|
||||||
f->f_fd = handle;
|
|
||||||
f->f_flags = _FOPEN;
|
|
||||||
|
|
||||||
/* Return the file descriptor */
|
/* Return the file descriptor */
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user