summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/reg-printf.c2
-rw-r--r--stdio-common/vfprintf.c9
-rw-r--r--stdio-common/vfscanf.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/stdio-common/reg-printf.c b/stdio-common/reg-printf.c
index db33a3d618..2cb086dedf 100644
--- a/stdio-common/reg-printf.c
+++ b/stdio-common/reg-printf.c
@@ -35,7 +35,7 @@ __register_printf_function (spec, converter, arginfo)
 {
   if (spec < 0 || spec > (int) UCHAR_MAX)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }
 
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index b2523574a8..f47eaa2850 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -102,7 +102,6 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
 	}								      \
     } while (0)
 # define UNBUFFERED_P(S) ((S)->_IO_file_flags & _IO_UNBUFFERED)
-/* This macro must be without parameter!  Don't change it.  */
 #else /* ! USE_IN_LIBIO */
 /* This code is for use in the GNU C library.  */
 # include <stdio.h>
@@ -113,7 +112,7 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
       /* Check file argument for consistence.  */			      \
       if (!__validfp(S) || !S->__mode.__write || Format == NULL)	      \
 	{								      \
-	  errno = EINVAL;						      \
+	  __set_errno (EINVAL);						      \
 	  return -1;							      \
 	}								      \
       if (!S->__seen)							      \
@@ -1431,6 +1430,9 @@ struct helper_file
   {
     struct _IO_FILE_plus _f;
     _IO_FILE *_put_stream;
+#ifdef _IO_MTSAFE_IO
+    _IO_lock_t lock;
+#endif
   };
 
 static int
@@ -1483,6 +1485,9 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
   hp->_IO_write_ptr = buf;
   hp->_IO_write_end = buf + sizeof buf;
   hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
+#ifdef _IO_MTSAFE_IO
+  hp->_lock = &helper.lock;
+#endif
   _IO_JUMPS (hp) = (struct _IO_jump_t *) &_IO_helper_jumps;
 
   /* Now print to helper instead.  */
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index f83fd281a1..ee2c922f6e 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -66,7 +66,7 @@ Cambridge, MA 02139, USA.  */
 			} while (0)
 # define memory_error()	do {						      \
 			  _IO_funlockfile (s);				      \
-			  errno = ENOMEM;				      \
+			  __set_errno (ENOMEM);				      \
 			  return EOF;					      \
 			} while (0)
 # define ARGCHECK(s, format)						      \
@@ -97,7 +97,7 @@ Cambridge, MA 02139, USA.  */
 			} while (0)
 # define memory_error()	do {						      \
 			  funlockfile (s);				      \
-			  errno = ENOMEM;				      \
+			  __set_errno (ENOMEM);				      \
 			  return EOF;					      \
 			} while (0)
 # define ARGCHECK(s, format)						      \
@@ -106,7 +106,7 @@ Cambridge, MA 02139, USA.  */
       /* Check file argument for consistence.  */			      \
       if (!__validfp (s) || !s->__mode.__read || format == NULL)	      \
 	{								      \
-	  errno = EINVAL;						      \
+	  __set_errno (EINVAL);						      \
 	  return EOF;							      \
 	}								      \
     } while (0)