This macro is useful as the check is not obvious, and we better abstract
this away.
if (MANAGER_IS_RELOADING(m))
return;
- /* Verify that we are actually running currently. Initially
- * the exit code is set to invalid, and during operation it is
- * then set to MANAGER_OK */
- if (m->exit_code != MANAGER_OK)
+ /* Verify that we have entered the event loop already, and not left it again. */
+ if (!MANAGER_IS_RUNNING(m))
return;
manager_check_basic_target(m);
#define MANAGER_IS_FINISHED(m) (dual_timestamp_is_set((m)->timestamps + MANAGER_TIMESTAMP_FINISH))
+/* The exit code is set to OK as soon as we enter the main loop, and set otherwise as soon as we are done with it */
+#define MANAGER_IS_RUNNING(m) ((m)->exit_code == MANAGER_OK)
+
int manager_new(UnitFileScope scope, unsigned test_run_flags, Manager **m);
Manager* manager_free(Manager *m);