Skip to content

Commit

Permalink
deal with a mkdir returning EEXIST (which can happen if something els…
Browse files Browse the repository at this point in the history
…e is also doing a safe_mkdir within the same directory tree)

Closes ocaml#231
  • Loading branch information
avsm committed Oct 9, 2012
1 parent 423cafe commit 0840964
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/opamSystem.ml
Expand Up @@ -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 =
Expand Down

0 comments on commit 0840964

Please sign in to comment.