diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-10-06 15:22:12 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-10-06 15:23:00 +0900 |
commit | 6525d3bcc7d0be65e2ff97d6785d9f36b5e4988a (patch) | |
tree | 08869d2ebe8cb930bc08f7a7248aab41680d6d93 | |
parent | 2ca353c2e0785056fea551d78e957bd753b17586 (diff) | |
download | ruby-6525d3bcc7d0be65e2ff97d6785d9f36b5e4988a.tar.gz |
test/dtrace/helper.rb: Etc.getgrnam may return nil on some platforms
-rw-r--r-- | test/dtrace/helper.rb | 2 |
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 |