summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/fclose.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fclose.c')
-rw-r--r--newlib/libc/stdio/fclose.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c
index 790496413..fd054feaa 100644
--- a/newlib/libc/stdio/fclose.c
+++ b/newlib/libc/stdio/fclose.c
@@ -78,7 +78,7 @@ _DEFUN(_fclose_r, (rptr, 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
@@ -87,7 +87,7 @@ _DEFUN(_fclose_r, (rptr, fp),
if (fp->_flags == 0) /* not open! */
{
_funlockfile (fp);
-#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS)
+#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
pthread_setcancelstate (__oldcancel, &__oldcancel);
#endif
return (0);
@@ -112,7 +112,7 @@ _DEFUN(_fclose_r, (rptr, fp),
#endif
__sfp_lock_release ();
-#if !defined (__SINGLE_THREAD__) && defined (_POSIX_THREADS)
+#ifdef _STDIO_WITH_THREAD_CANCELLATION_SUPPORT
pthread_setcancelstate (__oldcancel, &__oldcancel);
#endif