summaryrefslogtreecommitdiff
path: root/test/dtrace
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-10-06 15:22:12 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-10-06 15:23:00 +0900
commit6525d3bcc7d0be65e2ff97d6785d9f36b5e4988a (patch)
tree08869d2ebe8cb930bc08f7a7248aab41680d6d93 /test/dtrace
parent2ca353c2e0785056fea551d78e957bd753b17586 (diff)
test/dtrace/helper.rb: Etc.getgrnam may return nil on some platforms
Diffstat (limited to 'test/dtrace')
-rw-r--r--test/dtrace/helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dtrace/helper.rb b/test/dtrace/helper.rb
index 7683a6a887..ce730800b4 100644
--- a/test/dtrace/helper.rb
+++ b/test/dtrace/helper.rb
@@ -19,7 +19,7 @@ if RUBY_PLATFORM =~ /linux/
impl = :stap
begin
require 'etc'
- ok = (%w[stapusr stapdev].map {|g|Etc.getgrnam(g).gid} & Process.groups).size == 2
+ ok = (%w[stapusr stapdev].map {|g|(Etc.getgrnam(g) || raise(ArgumentError)).gid} & Process.groups).size == 2
rescue LoadError, ArgumentError
end unless ok
end