Skip to content
Snippets Groups Projects
Commit a18fdbcf authored by Lars Kanis's avatar Lars Kanis
Browse files

Respect the exitcode of the forked process for chdir

parent f1bf143b
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,8 @@ module FileUtils
alias unforked_fileutils_cd cd
def cd(dir, options={}, &block)
raise "chdir called without block" unless block_given?
Process.waitpid(fork{ unforked_fileutils_cd(dir, options, &block) })
pid = Process.waitpid(fork{ unforked_fileutils_cd(dir, options, &block) })
raise "Error in subprocess" if $?.exitstatus != 0
end
module_function :cd
alias chdir cd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment