forked from KolibriOS/kolibrios
newlib-2.1.0
git-svn-id: svn://kolibrios.org@4921 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -76,11 +76,20 @@ _DEFUN(_fclose_r, (rptr, fp),
|
||||
|
||||
CHECK_INIT (rptr, fp);
|
||||
|
||||
/* We can't use the _newlib_flockfile_XXX macros here due to the
|
||||
interlocked locking with the sfp_lock. */
|
||||
#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
|
||||
int __oldcancel;
|
||||
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &__oldcancel);
|
||||
#endif
|
||||
_flockfile (fp);
|
||||
|
||||
if (fp->_flags == 0) /* not open! */
|
||||
{
|
||||
_funlockfile (fp);
|
||||
#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
|
||||
pthread_setcancelstate (__oldcancel, &__oldcancel);
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
/* Unconditionally flush to allow special handling for seekable read
|
||||
@@ -103,6 +112,9 @@ _DEFUN(_fclose_r, (rptr, fp),
|
||||
#endif
|
||||
|
||||
__sfp_lock_release ();
|
||||
#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
|
||||
pthread_setcancelstate (__oldcancel, &__oldcancel);
|
||||
#endif
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
Reference in New Issue
Block a user