about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-08-17 09:35:15 -0700
committerRoland McGrath <roland@hack.frob.com>2012-08-17 09:35:15 -0700
commitc75ccd4c3a84993ea392f23f2cf75f7274e22cc1 (patch)
tree49f67c33b43674aa355a7c1931ccdbbdf2e4ce31 /stdio-common
parentd9195db871b11e139050dfa00e333ca8b2f7a677 (diff)
downloadglibc-c75ccd4c3a84993ea392f23f2cf75f7274e22cc1.tar.gz
glibc-c75ccd4c3a84993ea392f23f2cf75f7274e22cc1.tar.xz
glibc-c75ccd4c3a84993ea392f23f2cf75f7274e22cc1.zip
Clean up definition of _LIBC_REENTRANT and _IO_MTSAFE_IO.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/Makefile4
-rw-r--r--stdio-common/isoc99_scanf.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index a29924bc7c..5d7ab532f4 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -123,9 +123,7 @@ scanf13-ENV = LOCPATH=$(common-objpfx)localedata
 bug14-ENV = LOCPATH=$(common-objpfx)localedata
 tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
 
-ifneq (,$(filter %REENTRANT, $(defines)))
-CPPFLAGS += -D_IO_MTSAFE_IO
-endif
+CPPFLAGS += $(libio-mtsafe)
 
 $(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
 	$(built-program-cmd) > $@ 2>&1
diff --git a/stdio-common/isoc99_scanf.c b/stdio-common/isoc99_scanf.c
index 2e04e700e4..2bd1e512c1 100644
--- a/stdio-common/isoc99_scanf.c
+++ b/stdio-common/isoc99_scanf.c
@@ -28,13 +28,17 @@ __isoc99_scanf (const char *format, ...)
   va_list arg;
   int done;
 
+#ifdef _IO_MTSAFE_IO
   _IO_acquire_lock_clear_flags2 (stdin);
+#endif
   stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
 
   va_start (arg, format);
   done = _IO_vfscanf (stdin, format, arg, NULL);
   va_end (arg);
 
+#ifdef _IO_MTSAFE_IO
   _IO_release_lock (stdin);
+#endif
   return done;
 }