diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-17 22:55:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-11-17 22:55:05 +0000 |
commit | 336227dbc3c22b9f16bbf8bb9e8764a57517d750 (patch) | |
tree | e51ddf1465595e038e93d09baa829efca5cee7c3 /cpukit | |
parent | 2006-11-17 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-336227dbc3c22b9f16bbf8bb9e8764a57517d750.tar.bz2 |
2006-11-17 Joel Sherrill <joel@OARcorp.com>
* libcsupport/src/sync.c: Do not dereference NULL reent.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 4 | ||||
-rw-r--r-- | cpukit/libcsupport/src/sync.c | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 3192859ee2..0d80208c13 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,9 @@ 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 timeout value. diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c index 8d1f52e725..ad1ac0e052 100644 --- a/cpukit/libcsupport/src/sync.c +++ b/cpukit/libcsupport/src/sync.c @@ -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) |