aboutsummaryrefslogtreecommitdiff
path: root/libio/obprintf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-08-11 05:19:24 +0000
committerUlrich Drepper <drepper@redhat.com>2001-08-11 05:19:24 +0000
commitc020d48c6e91b351cefebbc7a82a9c1ec2d9d83b (patch)
tree28f297727c45d6197e23e00356713030cc9cc9fb /libio/obprintf.c
parent07ba7349279441bd084c8661a4e53c19cba12bf6 (diff)
downloadglibc-c020d48c6e91b351cefebbc7a82a9c1ec2d9d83b.tar
glibc-c020d48c6e91b351cefebbc7a82a9c1ec2d9d83b.tar.gz
glibc-c020d48c6e91b351cefebbc7a82a9c1ec2d9d83b.tar.bz2
glibc-c020d48c6e91b351cefebbc7a82a9c1ec2d9d83b.zip
Update.
* libio/iovdprintf.c (_IO_vdprintf): Set _IO_USER_LOCK flag for temporary stream. Don't define lock. * libio/iovsprintf.c: Likewise. * libio/iovsnprintf.c: Likewise. * libio/iovswprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/iovswscanf.c: Likewise. * stdio-common/vfprintf.c [USE_IN_LIBIO] (buffered_vfprintf): Likewise. * libio/genops.c (_IO_no_init): Don't call _IO_lock_init if _lock is NULL. (_IO_default_finish): Likewise. * libio/wgenops.c (_IO_wdefault_finish): Likewise.
Diffstat (limited to 'libio/obprintf.c')
-rw-r--r--libio/obprintf.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libio/obprintf.c b/libio/obprintf.c
index c0f0e8c8ff..9ef90bb5e3 100644
--- a/libio/obprintf.c
+++ b/libio/obprintf.c
@@ -124,19 +124,16 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
struct obstack_FILE
{
struct _IO_obstack_file ofile;
-#ifdef _IO_MTSAFE_IO
- _IO_lock_t lock;
-#endif
} new_f;
int result;
int size;
int room;
#ifdef _IO_MTSAFE_IO
- new_f.ofile.file.file._lock = &new_f.lock;
+ new_f.ofile.file.file._lock = NULL;
#endif
- _IO_no_init (&new_f.ofile.file.file, 0, -1, NULL, NULL);
+ _IO_no_init (&new_f.ofile.file.file, _IO_USER_LOCK, -1, NULL, NULL);
_IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps;
room = obstack_room (obstack);
size = obstack_object_size (obstack) + room;
@@ -156,7 +153,8 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
assert (size != 0);
}
- _IO_str_init_static ((struct _IO_strfile_ *) &new_f.ofile, obstack_base (obstack),
+ _IO_str_init_static ((struct _IO_strfile_ *) &new_f.ofile,
+ obstack_base (obstack),
size, obstack_next_free (obstack));
/* Now allocate the rest of the current chunk. */
assert (size == (new_f.ofile.file.file._IO_write_end
@@ -167,11 +165,8 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
obstack_blank_fast (obstack, room);
new_f.ofile.obstack = obstack;
-#ifdef _IO_MTSAFE_IO
- __fsetlocking ((FILE *) &new_f.ofile.file, FSETLOCKING_BYCALLER);
-#endif
- result = _IO_vfprintf ((_IO_FILE *) &new_f.ofile.file, format, args);
+ result = _IO_vfprintf (&new_f.ofile.file.file, format, args);
/* Shrink the buffer to the space we really currently need. */
obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr