summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--file.c28
-rw-r--r--test/ruby/test_process.rb3
2 files changed, 27 insertions, 4 deletions
diff --git a/file.c b/file.c
index 10da703059..d60a46c350 100644
--- a/file.c
+++ b/file.c
@@ -4400,6 +4400,21 @@ rb_check_realpath_emulate(VALUE basedir, VALUE path, rb_encoding *origenc, enum
static VALUE rb_file_join(VALUE ary);
+#ifndef HAVE_REALPATH
+static VALUE
+rb_check_realpath_emulate_try(VALUE arg)
+{
+ VALUE *args = (VALUE *)arg;
+ return rb_check_realpath_emulate(args[0], args[1], (const rb_encoding *)args[2], RB_REALPATH_CHECK);
+}
+
+static VALUE
+rb_check_realpath_emulate_rescue(VALUE arg, VALUE exc)
+{
+ return Qnil;
+}
+#endif /* HAVE_REALPATH */
+
static VALUE
rb_check_realpath_internal(VALUE basedir, VALUE path, rb_encoding *origenc, enum rb_realpath_mode mode)
{
@@ -4466,7 +4481,18 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, rb_encoding *origenc, enum
RB_GC_GUARD(unresolved_path);
return resolved;
#else
- return rb_check_realpath_emulate(basedir, path, origenc, mode);
+ if (mode == RB_REALPATH_CHECK) {
+ VALUE arg[3];
+ arg[0] = basedir;
+ arg[1] = path;
+ arg[2] = (VALUE)origenc;
+
+ return rb_rescue(rb_check_realpath_emulate_try, (VALUE)arg,
+ rb_check_realpath_emulate_rescue, Qnil);
+ }
+ else {
+ return rb_check_realpath_emulate(basedir, path, origenc, mode);
+ }
#endif /* HAVE_REALPATH */
}
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 98c934945c..07aa58418b 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1732,9 +1732,6 @@ class TestProcess < Test::Unit::TestCase
end
def test_no_curdir
- if /solaris/i =~ RUBY_PLATFORM
- skip "Temporary skip to avoid CI failures after commit to use realpath on required files"
- end
with_tmpchdir {|d|
Dir.mkdir("vd")
status = nil