Browse Source

BUG: Always return positive integers to the OS on error. Windows error encoding is confused by negative return values.

Brad King 18 years ago
parent
commit
ecf24b1671
1 changed files with 11 additions and 1 deletions
  1. 11 1
      Source/cmakemain.cxx

+ 11 - 1
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;
+    }
 }