Bug #7789 ยป setsid-openbsd.diff
| test/ruby/test_process.rb | ||
|---|---|---|
|
# test Process.getsid() w/o arg
|
||
|
assert_equal(Marshal.load(io), Process.getsid)
|
||
|
# test Process.setsid return value and Process::getsid(pid)
|
||
|
assert_equal(Marshal.load(io), Process.getsid(io.pid))
|
||
|
if /openbsd/ =~ RUBY_PLATFORM
|
||
|
# OpenBSD doesn't allow Process::getsid(pid) when pid is in
|
||
|
# different session.
|
||
|
refute_equal(Marshal.load(io), Process.getsid)
|
||
|
else
|
||
|
# test Process.setsid return value and Process::getsid(pid)
|
||
|
assert_equal(Marshal.load(io), Process.getsid(io.pid))
|
||
|
end
|
||
|
Process.kill(:KILL, io.pid)
|
||
|
end
|
||
|
end
|
||