diff --git a/Framework/Core/include/Framework/runDataProcessing.h b/Framework/Core/include/Framework/runDataProcessing.h index 186d76499c1d6..75e2a964ccba1 100644 --- a/Framework/Core/include/Framework/runDataProcessing.h +++ b/Framework/Core/include/Framework/runDataProcessing.h @@ -31,7 +31,6 @@ #include "Framework/StructToTuple.h" #include -#include namespace o2::framework { @@ -211,6 +210,7 @@ int mainNoCatch(int argc, char** argv) } int callMain(int argc, char** argv, int (*)(int, char**)); +char *getIdString(int argc, char** argv); int main(int argc, char** argv) { @@ -219,13 +219,7 @@ int main(int argc, char** argv) int result = callMain(argc, argv, mainNoCatch); - char* idstring = nullptr; - for (int argi = 0; argi < argc; argi++) { - if (strcmp(argv[argi], "--id") == 0 && argi + 1 < argc) { - idstring = argv[argi + 1]; - break; - } - } + char* idstring = getIdString(argc, argv); o2::framework::OnWorkflowTerminationHook onWorkflowTerminationHook; UserCustomizationsHelper::userDefinedCustomization(onWorkflowTerminationHook, 0); onWorkflowTerminationHook(idstring); diff --git a/Framework/Core/src/runDataProcessing.cxx b/Framework/Core/src/runDataProcessing.cxx index 6b424ee6a4261..f233eb5b72667 100644 --- a/Framework/Core/src/runDataProcessing.cxx +++ b/Framework/Core/src/runDataProcessing.cxx @@ -182,6 +182,15 @@ void doBoostException(boost::exception& e, const char*); void doDPLException(o2::framework::RuntimeErrorRef& ref, char const*); void doUnknownException(std::string const& s, char const*); +char *getIdString(int argc, char** argv) { + for (int argi = 0; argi < argc; argi++) { + if (strcmp(argv[argi], "--id") == 0 && argi + 1 < argc) { + return argv[argi + 1]; + } + } + return nullptr; +} + int callMain(int argc, char** argv, int (*mainNoCatch)(int, char**)) { static bool noCatch = getenv("O2_NO_CATCHALL_EXCEPTIONS") && strcmp(getenv("O2_NO_CATCHALL_EXCEPTIONS"), "0");