diff -urp libc.org/stdio/fclose.c libc/stdio/fclose.c --- libc.org/stdio/fclose.c 2004-01-19 09:44:42.879416000 +0100 +++ libc/stdio/fclose.c 2004-01-19 09:46:39.256758400 +0100 @@ -83,11 +83,11 @@ _DEFUN (fclose, (fp), FREEUB (fp); if (HASLB (fp)) FREELB (fp); - fp->_flags = 0; /* release this FILE for reuse */ _funlockfile(fp); #ifndef __SINGLE_THREAD__ __lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock); #endif + fp->_flags = 0; /* release this FILE for reuse */ return (r); } diff -urp libc.org/stdio/freopen.c libc/stdio/freopen.c --- libc.org/stdio/freopen.c 2004-01-19 09:45:11.911161600 +0100 +++ libc/stdio/freopen.c 2004-01-19 09:46:19.959009600 +0100 @@ -148,12 +148,12 @@ _DEFUN (_freopen_r, (ptr, file, mode, fp if (f < 0) { /* did not get it after all */ - fp->_flags = 0; /* set it free */ ptr->_errno = e; /* restore in case _close clobbered */ _funlockfile(fp); #ifndef __SINGLE_THREAD__ __lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock); #endif + fp->_flags = 0; /* set it free */ return NULL; }