From 90314a4d94f30d830acd186030a1b264cbd7a03e Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 5 Sep 2016 13:35:57 -0700 Subject: [PATCH] Catch Unix exceptions in DB.create_dir Reviewed By: sblackshear Differential Revision: D3811332 fbshipit-source-id: f05de5d --- infer/src/backend/DB.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer/src/backend/DB.ml b/infer/src/backend/DB.ml index 22f50530b..9af438f45 100644 --- a/infer/src/backend/DB.ml +++ b/infer/src/backend/DB.ml @@ -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))