Kernel.exec still failing in OS X Leopard [closes GH-544]

This commit is contained in:
Eriksen Costa 2011-11-01 22:51:06 -02:00 committed by Mitchell Hashimoto
parent db491e1f9b
commit 82c679b9a5
2 changed files with 2 additions and 4 deletions

View File

@ -53,9 +53,6 @@ module Vagrant
command_options << "-o ForwardX11Trusted=yes"
end
# Some hackery going on here. On Mac OS X Leopard (10.5), exec fails
# (GH-51). As a workaround, we fork and wait. On all other platforms,
# we simply exec.
command = "ssh #{command_options.join(" ")} #{options[:username]}@#{options[:host]}".strip
env.logger.info("ssh") { "Invoking SSH: #{command}" }
safe_exec(command)

View File

@ -2,7 +2,7 @@ module Vagrant
module Util
# This module provies a `safe_exec` method which is a drop-in
# replacement for `Kernel.exec` which addresses a specific issue
# which manifests on OS X 10.5 and perhaps other operating systems.
# which manifests on OS X 10.5 (GH-51) and perhaps other operating systems.
# This issue causes `exec` to fail if there is more than one system
# thread. In that case, `safe_exec` automatically falls back to
# forking.
@ -14,6 +14,7 @@ module Vagrant
rescue_from = []
rescue_from << Errno::EOPNOTSUPP if defined?(Errno::EOPNOTSUPP)
rescue_from << Errno::E045 if defined?(Errno::E045)
rescue_from << SystemCallError
fork_instead = false
begin