diff --git a/Code/Wrappers/CommandLine/otbApplicationLauncherCommandLine.cxx b/Code/Wrappers/CommandLine/otbApplicationLauncherCommandLine.cxx index 8b079ef0a27a352ea1ccb675aec3c26d27bccd75..69810d3cd0de3cd977239124db9ee3fb20cc5584 100644 --- a/Code/Wrappers/CommandLine/otbApplicationLauncherCommandLine.cxx +++ b/Code/Wrappers/CommandLine/otbApplicationLauncherCommandLine.cxx @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) if (launcher->Load(exp) == true) { - if (launcher->ExecuteAndWriteOutput() == false) + if (launcher->ExecuteAndWriteOutput() == true) { return EXIT_FAILURE; } diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx index d73f54c554b66b9aab03b880b6af0cb5593e3a69..3f180ec29847b4d1c1ba0e4049205ab3990b0e24 100644 --- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx +++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx @@ -138,26 +138,29 @@ CommandLineLauncher::Execute() { if( this->BeforeExecute() == false ) { - return false; + return true; } - m_Application->Execute(); - return true; - + int res = m_Application->Execute(); + if (res == 0) + return false; + else return true; } bool CommandLineLauncher::ExecuteAndWriteOutput() { - if( this->BeforeExecute() == false ) + if (this->BeforeExecute() == false) { - return false; + return true; } - m_Application->ExecuteAndWriteOutput(); - return true; - + int res = m_Application->ExecuteAndWriteOutput(); + + if (res == 0) + return false; + else return true; }