summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-07 03:47:47 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-07 03:47:47 +0000
commite6368921eabf3874e8d6caab3d9af423768937d6 (patch)
treeefae254ac2a053addc802cfaccfbe92bf3e08fe5
parenta179d0d242b7d7e06b42acec21a4c8a48b5fb241 (diff)
* process.c: PTHREAD_CANCEL_DISABLE is not defined on Android.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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) {