android: pthread_sigmask() does not set errno
Originally intended workaround is especially needed for Android <4.4. However it fails to compare errno collected from pthread_sigmask. This has been fixed separately in JXcore. See issue: https://github.com/jxcore/jxcore-cordova/issues/55 PR-URL: https://github.com/libuv/libuv/pull/833 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
4a5b3f982e
commit
70d5014266
@ -39,19 +39,23 @@
|
||||
|
||||
int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset) {
|
||||
static int workaround;
|
||||
int err;
|
||||
|
||||
if (workaround) {
|
||||
return sigprocmask(how, set, oset);
|
||||
} else if (pthread_sigmask(how, set, oset)) {
|
||||
if (errno == EINVAL && sigprocmask(how, set, oset) == 0) {
|
||||
workaround = 1;
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
err = pthread_sigmask(how, set, oset);
|
||||
if (err) {
|
||||
if (err == EINVAL && sigprocmask(how, set, oset) == 0) {
|
||||
workaround = 1;
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*Android doesn't provide pthread_barrier_t for now.*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user