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))