]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdio-common/isoc99_scanf.c
Deprecate external use of libio.h and _G_config.h.
[thirdparty/glibc.git] / stdio-common / isoc99_scanf.c
index a90fe7018c19b1ded7d5423e0a43a0a7202e8c42..5a384c9757cc411c1773e8ce55cc968e3e79e69a 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1995, 1996, 1997, 2002, 2004, 2006, 2007
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,9 +12,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -30,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 = INTUSE(_IO_vfscanf) (stdin, format, arg, NULL);
+  done = _IO_vfscanf (stdin, format, arg, NULL);
   va_end (arg);
 
+#ifdef _IO_MTSAFE_IO
   _IO_release_lock (stdin);
+#endif
   return done;
 }