From 927d2a17d656715ea260a57fa914ff65d1a427fe Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 18 Oct 2016 18:54:26 +0200 Subject: Catch errors from Unix for isatty. There is a bug in the fstat implementation in ocaml 4.03 under windows. In order to prevent this we guard the isatty function with an additional try with. --- cparser/Cerrors.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cparser') diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml index c50e12d9..804d3127 100644 --- a/cparser/Cerrors.ml +++ b/cparser/Cerrors.ml @@ -21,7 +21,10 @@ open Commandline let error_fatal = ref false let color_diagnostics = let term = try Sys.getenv "TERM" with Not_found -> "" in - ref (Unix.isatty Unix.stderr && term <> "dumb" && term <>"") + let activate = try + (Unix.isatty Unix.stderr && term <> "dumb" && term <>"") + with _ -> false in + ref activate let num_errors = ref 0 let num_warnings = ref 0 -- cgit