4 ** Ullrich von Bassewitz, 17.06.1998
16 /*****************************************************************************/
18 /*****************************************************************************/
22 FILE* __fastcall__ freopen (const char* name, const char* mode, FILE* f)
24 /* Check if the file is open, if so, close it */
25 if ((f->f_flags & _FOPEN) == 0) {
26 /* File is not open */
27 return (FILE*) _seterrno (EINVAL); /* File not input */
30 /* Close the file. Don't bother setting the flag, it will get
31 ** overwritten by _fopen.
33 if (close (f->f_fd) < 0) {
34 /* An error occured, errno is already set */
38 /* Open the file and return the descriptor */
39 return _fopen (name, mode, f);