From 810713d1e5279462e427069bf8988fb4c2a57caa Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Thu, 25 May 2017 23:44:36 +0100 Subject: [PATCH] within_sandbox: Check fork is supported --- lib/capsicum.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/capsicum.rb b/lib/capsicum.rb index 49a1751..4153ab9 100644 --- a/lib/capsicum.rb +++ b/lib/capsicum.rb @@ -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