File bsc#1181744-0003-Refactor-fencing-new-function-stonith_op_state_pendi-1.1.patch of Package pacemaker.22685

79ec59889 Refactor: fencing: new function stonith_op_state_pending() for checking if a fencing operation is in pending state
 include/crm/fencing/internal.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/crm/fencing/internal.h b/include/crm/fencing/internal.h
index 5220001a2..61fbac312 100644
--- a/include/crm/fencing/internal.h
+++ b/include/crm/fencing/internal.h
@@ -164,4 +164,18 @@ int stonith__rhcs_validate(stonith_t *st, int call_options, const char *target,
                            const char *agent, GHashTable *params, const char *host_arg,
                            int timeout, char **output, char **error_output);
 
+/*!
+ * \internal
+ * \brief Is a fencing operation in pending state?
+ *
+ * \param[in] state     State as enum op_state value
+ *
+ * \return A boolean
+ */
+static inline bool
+stonith__op_state_pending(enum op_state state)
+{
+    return state != st_failed && state != st_done;
+}
+
 #endif
-- 
2.26.2

openSUSE Build Service is sponsored by