2006-11-17 Joel Sherrill <joel@OARcorp.com>

* libcsupport/src/sync.c: Do not dereference NULL reent.
This commit is contained in:
Joel Sherrill
2006-11-17 22:54:33 +00:00
parent e2cafb006a
commit e992fa47b8
2 changed files with 12 additions and 4 deletions

View File

@@ -1,3 +1,7 @@
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* libcsupport/src/sync.c: Do not dereference NULL reent.
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* posix/src/semtimedwait.c: Used wrong constant for blocking with bad

View File

@@ -55,15 +55,19 @@ static void sync_wrapper(FILE *f)
static void sync_per_thread(Thread_Control *t)
{
struct _reent *current_reent;
struct _reent *this_reent;
/*
* The sync_wrapper() function will operate on the current thread's
* reent structure so we will temporarily use that.
*/
current_reent = _Thread_Executing->libc_reent;
_Thread_Executing->libc_reent = t->libc_reent;
_fwalk (t->libc_reent, sync_wrapper);
_Thread_Executing->libc_reent = current_reent;
this_reent = t->libc_reent;
if ( this_reent ) {
current_reent = _Thread_Executing->libc_reent;
_Thread_Executing->libc_reent = this_reent;
_fwalk (t->libc_reent, sync_wrapper);
_Thread_Executing->libc_reent = current_reent;
}
}
int sync(void)