diff options
author | Teemu Torma <tot@trema.com> | 1998-03-11 12:07:25 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1998-03-11 04:07:25 -0800 |
commit | 754d1a92e65d7a8fdfdc36e2b72e8abfdcf70f5b (patch) | |
tree | 722397066de1f2780c4301c0a26524b7d9b93805 /gcc/gthr-solaris.h | |
parent | ffacfc7cb67870796368b9dfa000d0e1f36ab879 (diff) | |
download | gcc-754d1a92e65d7a8fdfdc36e2b72e8abfdcf70f5b.zip gcc-754d1a92e65d7a8fdfdc36e2b72e8abfdcf70f5b.tar.gz gcc-754d1a92e65d7a8fdfdc36e2b72e8abfdcf70f5b.tar.bz2 |
Patch from Teemu Torma to fix Solaris 2.6 EH failures.
* gthr.h: Changed the comment about return values.
* gthr-solaris.h (__gthread_once): Do not use errno; return the
error number instead of -1.
(__gthread_key_create): Any non-zero return value is an error.
* libgcc2.c (eh_context_initialize): Check for non-zero return
value from __gthread_once.
Check that the value of get_eh_context was really changed.
From-SVN: r18480
Diffstat (limited to 'gcc/gthr-solaris.h')
-rw-r--r-- | gcc/gthr-solaris.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/gthr-solaris.h b/gcc/gthr-solaris.h index 465ecec..a6f669c 100644 --- a/gcc/gthr-solaris.h +++ b/gcc/gthr-solaris.h @@ -88,15 +88,13 @@ __gthread_once (__gthread_once_t *once, void (*func) ()) return -1; if (once == 0 || func == 0) - { - errno = EINVAL; - return -1; - } + return EINVAL; if (once->once == 0) { - if (mutex_lock (&once->mutex) != 0) - return -1; + int status = mutex_lock (&once->mutex); + if (status != 0) + return status; if (once->once == 0) { (*func) (); @@ -113,7 +111,7 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) /* Solaris 2.5 contains thr_* routines no-op in libc, so test if we actually got a reasonable key value, and if not, fail. */ *key = -1; - if (thr_keycreate (key, dtor) == -1 || *key == -1) + if (thr_keycreate (key, dtor) != 0 || *key == -1) return -1; else return 0; |