Browse files

deal with a mkdir returning EEXIST (which can happen if something els…

…e is also doing a safe_mkdir within the same directory tree)

Closes #231
  • Loading branch information...
1 parent 423cafe commit 084096466f0d7b39e2f633a7b6a09e4a239d2e8c @avsm committed Oct 9, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/opamSystem.ml
View
4 src/opamSystem.ml
@@ -71,8 +71,10 @@ let log_file () =
!OpamGlobals.root_dir / "log" / f
let safe_mkdir dir =
+ let open Unix in
if not (Sys.file_exists dir) then
- Unix.mkdir dir 0o755
+ try mkdir dir 0o755
+ with Unix_error(EEXIST,_,_) -> ()
let mkdir dir =
let rec aux dir =

0 comments on commit 0840964

Please sign in to comment.