Skip to content

Commit

Permalink
iox-eclipse-iceoryx#91 Returning the status code of run() is defacto …
Browse files Browse the repository at this point in the history
…standard

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Dec 8, 2020
1 parent 7c5018d commit e855dd3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class IceOryxRouDiApp : public RouDiApp
IceOryxRouDiApp(const config::CmdLineParser& cmdLineParser, const RouDiConfig_t& roudiConfig) noexcept;

/// @brief starts the execution of the RouDi daemon
void run() noexcept override;
/// @return Return code for programm execution
uint8_t run() noexcept override;
};

} // namespace roudi
Expand Down
3 changes: 2 additions & 1 deletion iceoryx_posh/include/iceoryx_posh/roudi/roudi_app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class RouDiApp
virtual ~RouDiApp() noexcept {};

/// @brief interface to start the execution of the RouDi daemon
virtual void run() noexcept = 0;
/// @return Return code for programm execution
virtual uint8_t run() noexcept = 0;

protected:
/// @brief this is needed for the child classes for custom CmdLineParser
Expand Down
3 changes: 2 additions & 1 deletion iceoryx_posh/source/roudi/application/iceoryx_roudi_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ IceOryxRouDiApp::IceOryxRouDiApp(const config::CmdLineParser& cmdLineParser, con
{
}

void IceOryxRouDiApp::run() noexcept
uint8_t IceOryxRouDiApp::run() noexcept
{
if (m_run)
{
Expand All @@ -46,6 +46,7 @@ void IceOryxRouDiApp::run() noexcept
m_processKillDelay});
waitForSignal();
}
return EXIT_SUCCESS;
}
} // namespace roudi
} // namespace iox
4 changes: 1 addition & 3 deletions iceoryx_posh/source/roudi/application/roudi_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,5 @@ int main(int argc, char* argv[])
/// @todo Add debug print about used RouDi params e.g. TOML file
IceOryxRouDiApp roudi(cmdLineParser, roudiConfig);

roudi.run();

return 0;
return roudi.run();
}

0 comments on commit e855dd3

Please sign in to comment.