aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-07 19:07:39 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-07 19:07:39 +0000
commit917e27b827508ea4d184d17f098f777bc918ebbd (patch)
tree728defedb4c4d4071dd5262941c2d6856119e91b
parent054d2bf7cc2fdc42ae29fae933fe30e0f121c308 (diff)
downloadglibc-917e27b827508ea4d184d17f098f777bc918ebbd.zip
glibc-917e27b827508ea4d184d17f098f777bc918ebbd.tar.gz
glibc-917e27b827508ea4d184d17f098f777bc918ebbd.tar.bz2
Update.
* stdlib/strfmon.c [USE_IN_LIBIO]: Define lock variable and store point in FILE structure before calling _IO_init. * stdlib/Makefile: Add -D_IO_MTSAFE_IO to CFLAGS for strfmon and strfmon_l if necessary. Reported by Jury Gerold <gjury@grips.com>.
-rw-r--r--ChangeLog6
-rw-r--r--stdlib/Makefile7
-rw-r--r--stdlib/strfmon.c6
3 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index efcb817..a5eeabb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2001-02-07 Ulrich Drepper <drepper@redhat.com>
+ * stdlib/strfmon.c [USE_IN_LIBIO]: Define lock variable and store
+ point in FILE structure before calling _IO_init.
+ * stdlib/Makefile: Add -D_IO_MTSAFE_IO to CFLAGS for strfmon and
+ strfmon_l if necessary.
+ Reported by Jury Gerold <gjury@grips.com>.
+
* sysdeps/gnu/netinet/tcp.h: Correct values of TCP_ macros.
Patch by Pekka.Pietikainen@cern.ch.
diff --git a/stdlib/Makefile b/stdlib/Makefile
index f875087..61c35eb 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -74,6 +74,13 @@ CFLAGS-bsearch.c = $(exceptions)
CFLAGS-msort.c = $(exceptions)
CFLAGS-qsort.c = $(exceptions)
+include ../Makeconfig
+
+ifneq (,$(filter %REENTRANT, $(defines)))
+CFLAGS-strfmon.c = -D_IO_MTSAFE_IO
+CFLAGS-strfmon_l.c = -D_IO_MTSAFE_IO
+endif
+
include ../Rules
diff --git a/stdlib/strfmon.c b/stdlib/strfmon.c
index eb4d096..e2d0802 100644
--- a/stdlib/strfmon.c
+++ b/stdlib/strfmon.c
@@ -101,6 +101,9 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
#endif
#ifdef USE_IN_LIBIO
_IO_strfile f;
+# ifdef _IO_MTSAFE_IO
+ _IO_lock_t lock;
+# endif
#else
FILE f;
#endif
@@ -525,6 +528,9 @@ __strfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, ...)
/* Print the number. */
#ifdef USE_IN_LIBIO
+# ifdef _IO_MTSAFE_IO
+ f._sbf._f._lock = &lock;
+# endif
_IO_init ((_IO_FILE *) &f, 0);
_IO_JUMPS ((struct _IO_FILE_plus *) &f) = &_IO_str_jumps;
_IO_str_init_static ((_IO_strfile *) &f, dest, (s + maxsize) - dest, dest);