summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/fileutils.rb3
-rw-r--r--test/pathname/test_pathname.rb2
-rw-r--r--test/ruby/test_notimp.rb19
-rw-r--r--version.h2
4 files changed, 16 insertions, 10 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 8981ef98e8..6332fcd6f1 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1320,6 +1320,7 @@ module FileUtils
else
File.chmod mode, path()
end
+ rescue Errno::EOPNOTSUPP
end
def chown(uid, gid)
@@ -1411,7 +1412,7 @@ module FileUtils
if st.symlink?
begin
File.lchmod mode, path
- rescue NotImplementedError
+ rescue NotImplementedError, Errno::EOPNOTSUPP
end
else
File.chmod mode, path
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index f8e4937802..750fabf039 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -824,7 +824,7 @@ class TestPathname < Test::Unit::TestCase
old = path.lstat.mode
begin
path.lchmod(0444)
- rescue NotImplementedError
+ rescue NotImplementedError, Errno::EOPNOTSUPP
next
end
assert_equal(0444, path.lstat.mode & 0777)
diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb
index ddebb657bf..daa5a82d7b 100644
--- a/test/ruby/test_notimp.rb
+++ b/test/ruby/test_notimp.rb
@@ -13,11 +13,11 @@ class TestNotImplement < Test::Unit::TestCase
def test_respond_to_lchmod
assert_include(File.methods, :lchmod)
- if /linux/ =~ RUBY_PLATFORM
- assert_equal(false, File.respond_to?(:lchmod))
- end
- if /freebsd/ =~ RUBY_PLATFORM
+ case RUBY_PLATFORM
+ when /freebsd/, /linux-musl/
assert_equal(true, File.respond_to?(:lchmod))
+ when /linux/
+ assert_equal(false, File.respond_to?(:lchmod))
end
end
@@ -57,9 +57,14 @@ class TestNotImplement < Test::Unit::TestCase
File.open(f, "w") {}
File.symlink f, g
newmode = 0444
- File.lchmod newmode, "#{d}/g"
- snew = File.lstat(g)
- assert_equal(newmode, snew.mode & 0777)
+ begin
+ File.lchmod newmode, "#{d}/g"
+ rescue Errno::EOPNOTSUPP
+ skip $!
+ else
+ snew = File.lstat(g)
+ assert_equal(newmode, snew.mode & 0777)
+ end
}
end
end
diff --git a/version.h b/version.h
index 2409c2bc7d..dc472d558b 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.6.7"
#define RUBY_RELEASE_DATE "2021-03-02"
-#define RUBY_PATCHLEVEL 166
+#define RUBY_PATCHLEVEL 167
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 3