mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
@ -43,9 +43,6 @@ _IO_vasprintf (result_ptr, format, args)
|
||||
const _IO_size_t init_string_size = 100;
|
||||
char *string;
|
||||
_IO_strfile sf;
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
_IO_lock_t lock;
|
||||
#endif
|
||||
int ret;
|
||||
_IO_size_t needed;
|
||||
_IO_size_t allocated;
|
||||
@ -53,18 +50,15 @@ _IO_vasprintf (result_ptr, format, args)
|
||||
if (string == NULL)
|
||||
return -1;
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
sf._sbf._f._lock = &lock;
|
||||
sf._sbf._f._lock = NULL;
|
||||
#endif
|
||||
_IO_no_init ((_IO_FILE *) &sf._sbf, 0, -1, NULL, NULL);
|
||||
_IO_no_init ((_IO_FILE *) &sf._sbf, _IO_USER_LOCK, -1, NULL, NULL);
|
||||
_IO_JUMPS ((struct _IO_FILE_plus *) &sf._sbf) = &_IO_str_jumps;
|
||||
_IO_str_init_static (&sf, string, init_string_size, string);
|
||||
sf._sbf._f._flags &= ~_IO_USER_BUF;
|
||||
sf._s._allocate_buffer = (_IO_alloc_type) malloc;
|
||||
sf._s._free_buffer = (_IO_free_type) free;
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
__fsetlocking ((FILE *) &sf, FSETLOCKING_BYCALLER);
|
||||
#endif
|
||||
ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
|
||||
ret = _IO_vfprintf (&sf._sbf._f, format, args);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* Only use realloc if the size we need is of the same order of
|
||||
|
Reference in New Issue
Block a user