Skip to content

Commit

Permalink
Fix race when opening first 2 Urchin instances
Browse files Browse the repository at this point in the history
Fixes #23.

Tested-by: Mark Somerville <mark@scottishclimbs.com> [Arch, MRI 2.2.2]
Signed-off-by: Mark Somerville <mark@scottishclimbs.com>
  • Loading branch information
Spakman committed Jun 29, 2015
1 parent 2b8dce7 commit 8a54c1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
Urchin::TMP_DIR = "/tmp/.urchin"
STDERR.puts "XDG_RUNTIME_DIR is not writable - using #{Urchin::TMP_DIR} instead."
end
FileUtils.mkdir Urchin::TMP_DIR unless File.directory? Urchin::TMP_DIR
begin
FileUtils.mkdir Urchin::TMP_DIR unless File.directory? Urchin::TMP_DIR
rescue Errno::EEXIST
end

# Start in the last changed to directory.
Urchin::Builtins::Cd::LAST_DIR = "#{Urchin::TMP_DIR}/lastdir"
Expand Down

0 comments on commit 8a54c1e

Please sign in to comment.