From ecf24b1671041d4243270fd1ec151eac8f9575aa Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 19 Nov 2007 13:42:54 -0500 Subject: [PATCH] BUG: Always return positive integers to the OS on error. Windows error encoding is confused by negative return values. --- Source/cmakemain.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 9e81a42a1..8d38f70f5 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -487,6 +487,16 @@ int do_cmake(int ac, char** av) } } } - return res; + + // Always return a non-negative value. Windows tools do not always + // interpret negative return values as errors. + if(res != 0) + { + return 1; + } + else + { + return 0; + } }