Catch Unix exceptions in DB.create_dir

Reviewed By: sblackshear

Differential Revision: D3811332

fbshipit-source-id: f05de5d
master
Josh Berdine 8 years ago committed by Facebook Github Bot 7
parent d11b2754a9
commit 90314a4d94

@ -198,7 +198,8 @@ let create_dir dir =
(try Unix.mkdir dir 0o700 with
Unix.Unix_error _ ->
let created_concurrently = (* check if another process created it meanwhile *)
(Unix.stat dir).Unix.st_kind = Unix.S_DIR in
try (Unix.stat dir).Unix.st_kind = Unix.S_DIR
with Unix.Unix_error _ -> false in
if not created_concurrently then
(L.err "@.ERROR: cannot create directory %s@." dir;
assert false))

Loading…
Cancel
Save