]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: make code robust
authorHiroshi Ioka <hirochachacha@gmail.com>
Tue, 11 Jul 2017 09:57:54 +0000 (18:57 +0900)
committerIan Lance Taylor <iant@golang.org>
Fri, 11 Aug 2017 18:51:24 +0000 (18:51 +0000)
commit51ba2bb81923298f08b8ec6d50d0c579b4b63ef3
tree92c408828ce1c146e565533e55a11f766dae43ba
parent57bf6aca711a53aa7fea877b98896cd0445c6ad0
runtime/cgo: make code robust

According to http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_key_create.html,
pthread_key_create return an error number which is greater than or equal
to 0. I don't know the scenario that pthread_setspecific would fail, but
also don't know the future. Add some error handlings just in case.

Change-Id: I0774b79ef658d67e300f4a9aab1f2e3879acc7ee
Reviewed-on: https://go-review.googlesource.com/54811
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/cgo/gcc_android_386.c
src/runtime/cgo/gcc_android_amd64.c
src/runtime/cgo/gcc_darwin_386.c
src/runtime/cgo/gcc_darwin_amd64.c