diff options
-rw-r--r-- | lib/libkse/thread/thr_create.c | 7 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_create.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/libkse/thread/thr_create.c b/lib/libkse/thread/thr_create.c index f552ee5..e9ab203 100644 --- a/lib/libkse/thread/thr_create.c +++ b/lib/libkse/thread/thr_create.c @@ -294,9 +294,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, ret = _thr_schedule_add(curthread, new_thread); if (ret != 0) free_thread(curthread, new_thread); - - /* Return a pointer to the thread structure: */ - (*thread) = new_thread; + else { + /* Return a pointer to the thread structure: */ + (*thread) = new_thread; + } } } diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index f552ee5..e9ab203 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/thread/thr_create.c @@ -294,9 +294,10 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, ret = _thr_schedule_add(curthread, new_thread); if (ret != 0) free_thread(curthread, new_thread); - - /* Return a pointer to the thread structure: */ - (*thread) = new_thread; + else { + /* Return a pointer to the thread structure: */ + (*thread) = new_thread; + } } } |