From 5ef2d37b330420c89cd476afa83ca5a839094796 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 9 Jul 1999 22:22:21 +0000 Subject: Update. 1999-07-09 Ulrich Drepper * stdio-common/vfprintf.c (buffered_vfprintf): Add locking. --- ChangeLog | 4 ++++ linuxthreads/ChangeLog | 5 +++++ linuxthreads/oldsemaphore.c | 3 +-- stdio-common/vfprintf.c | 12 ++++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b22b91550a..01e50e58c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1999-07-09 Ulrich Drepper + + * stdio-common/vfprintf.c (buffered_vfprintf): Add locking. + 1999-07-09 H.J. Lu * Versions.def (GLIBC_2.1.2): Added. diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 5012b244eb..8432d2d756 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +1999-07-09 Ulrich Drepper + + * oldsemaphore.c (sem_compare_and_swap): Fix use of compare and + swap function. + 1999-07-09 Cristian Gafton * Makefile (libpthread-routines): Add oldsemaphore routine. diff --git a/linuxthreads/oldsemaphore.c b/linuxthreads/oldsemaphore.c index 5a19a45b7f..72d12d20c3 100644 --- a/linuxthreads/oldsemaphore.c +++ b/linuxthreads/oldsemaphore.c @@ -37,7 +37,7 @@ typedef struct { static inline int sem_compare_and_swap(old_sem_t *sem, long oldval, long newval) { - return __pthread_compare_and_swap(&sem->sem_status, oldval, newval, &sem->sem_spinlock); + return compare_and_swap(&sem->sem_status, oldval, newval, &sem->sem_spinlock); } /* The state of a semaphore is represented by a long int encoding @@ -212,4 +212,3 @@ symbol_version (__old_sem_post, sem_post, GLIBC_2.0); symbol_version (__old_sem_getvalue, sem_getvalue, GLIBC_2.0); symbol_version (__old_sem_destroy, sem_destroy, GLIBC_2.0); #endif - diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index f167058d17..902a70df40 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1886,6 +1886,10 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format, /* Now print to helper instead. */ result = vfprintf (hp, format, args); + /* Lock stream. */ + __libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s); + _IO_flockfile (s); + /* Now flush anything from the helper to the S. */ #ifdef COMPILE_WPRINTF if ((to_flush = (hp->_wide_data->_IO_write_ptr @@ -1893,16 +1897,20 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format, { if ((int) _IO_sputn (s, hp->_wide_data->_IO_write_base, to_flush) != to_flush) - return -1; + result = -1; } #else if ((to_flush = hp->_IO_write_ptr - hp->_IO_write_base) > 0) { if ((int) _IO_sputn (s, hp->_IO_write_base, to_flush) != to_flush) - return -1; + result = -1; } #endif + /* Unlock the stream. */ + _IO_funlockfile (s); + __libc_cleanup_region_end (0); + return result; } -- cgit v1.2.3