within_sandbox: Check fork is supported

This commit is contained in:
Thomas Hurst 2017-05-25 23:44:36 +01:00
parent 2dd1aef8a4
commit 810713d1e5

View file

@ -55,6 +55,8 @@ module Capsicum
# @yield block to run within the forked child.
# @return [Process::Status] exit status of the forked child.
def within_sandbox
raise NotImplementedError, "fork() not supported" unless Process.respond_to? :fork
return enum_for(:within_sandbox) unless block_given?
pid = fork do