summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-26 09:32:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-26 09:32:42 +0000
commit05316c40ac6872eb2b91b9d08b4b9e36cbac488d (patch)
treed4d8b088d5a21160d9166ca323cfba44d78ae438
parent97538e813f8d41d7091aa6d1ffd15466117b26b1 (diff)
fork() is deprecated on Solaris
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--mjit.c7
-rw-r--r--process.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/mjit.c b/mjit.c
index 36ffae4..4344985 100644
--- a/mjit.c
+++ b/mjit.c
@@ -381,7 +381,14 @@ start_process(const char *path, char *const *argv)
}
dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
if ((pid = vfork()) == 0) {
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
umask(0077);
if (mjit_opts.verbose == 0) {
/* CC can be started in a thread using a file which has been
diff --git a/process.c b/process.c
index d1d33dd..956db99 100644
--- a/process.c
+++ b/process.c
@@ -3867,6 +3867,10 @@ retry_fork_async_signal_safe(int *status, int *ep,
while (1) {
prefork();
disable_child_handler_before_fork(&old);
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
#ifdef HAVE_WORKING_VFORK
if (!has_privilege())
pid = vfork();
@@ -3875,6 +3879,9 @@ retry_fork_async_signal_safe(int *status, int *ep,
#else
pid = fork();
#endif
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
if (pid == 0) {/* fork succeed, child process */
int ret;
close(ep[0]);
@@ -3943,7 +3950,14 @@ rb_fork_ruby(int *status)
prefork();
disable_child_handler_before_fork(&old);
before_fork_ruby();
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
pid = fork();
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
err = errno;
after_fork_ruby();
disable_child_handler_fork_parent(&old); /* yes, bad name */