summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--process.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c7270a..7f74034 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Sep 7 12:47:06 2014 Tanaka Akira <akr@fsij.org>
+
+ * process.c: PTHREAD_CANCEL_DISABLE is not defined on Android.
+
Sat Sep 6 20:59:06 2014 Tanaka Akira <akr@fsij.org>
* process.c (has_privilege): The gid zero is not a privilege.
diff --git a/process.c b/process.c
index 62566dd..8bb52f7 100644
--- a/process.c
+++ b/process.c
@@ -3403,11 +3403,13 @@ disable_child_handler_before_fork(struct child_handler_disabler_state *old)
rb_sys_fail("pthread_sigmask");
}
+#ifdef PTHREAD_CANCEL_DISABLE
ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old->cancelstate);
if (ret != 0) {
errno = ret;
rb_sys_fail("pthread_setcancelstate");
}
+#endif
}
static void
@@ -3415,11 +3417,13 @@ disable_child_handler_fork_parent(struct child_handler_disabler_state *old)
{
int ret;
+#ifdef PTHREAD_CANCEL_DISABLE
ret = pthread_setcancelstate(old->cancelstate, NULL);
if (ret != 0) {
errno = ret;
rb_sys_fail("pthread_setcancelstate");
}
+#endif
ret = pthread_sigmask(SIG_SETMASK, &old->sigmask, NULL); /* not async-signal-safe */
if (ret != 0) {