2013-03-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/stdio/local.h (_STDIO_WITH_THREAD_CANCELLATION_SUPPORT): New define. * libc/stdio/fclose.c: Use _STDIO_WITH_THREAD_CANCELLATION_SUPPORT. * libc/stdio/freopen.c: Likewise. * libc/stdio64/freopen64.c: Likewise.
This commit is contained in:
@ -102,7 +102,7 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp),
|
||||
|
||||
/* We can't use the _newlib_flockfile_XXX macros here due to the
|
||||
interlocked locking with the sfp_lock. */
|
||||
#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS)
|
||||
#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
|
||||
int __oldcancel;
|
||||
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &__oldcancel);
|
||||
#endif
|
||||
@ -111,7 +111,7 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp),
|
||||
if ((flags = __sflags (ptr, mode, &oflags)) == 0)
|
||||
{
|
||||
_funlockfile (fp);
|
||||
#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS)
|
||||
#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
|
||||
pthread_setcancelstate (__oldcancel, &__oldcancel);
|
||||
#endif
|
||||
_fclose_r (ptr, fp);
|
||||
|
Reference in New Issue
Block a user