/**
- * Executes a configured setup, using the built-in method for querying the user.
+ * Loop through configured query_user slots, using the built-in method for
+ * querying the user.
* This method uses the console/TTY directly.
*
- * @param setup Pointer to the setup defining what to ask the user
- *
* @return True if executing all the defined steps completed successfully
*/
bool query_user_exec_builtin(void);
#if defined(ENABLE_SYSTEMD)
/**
- * Executes a configured setup, using the compiled method for querying the user
+ * Loop through configured query_user slots, using the systemd method for
+ * querying the user.
+ * If systemd is not running it will fall back to use
+ * query_user_exec_builtin() instead.
*
- * @param setup Pointer to the setup defining what to ask the user
+ * @return True if executing all the defined steps completed successfully
+ */
+bool query_user_exec_systemd(void);
+
+/**
+ * Loop through configured query_user slots, using the compiled method for
+ * querying the user.
*
* @return True if executing all the defined steps completed successfully
*/
-bool query_user_exec(void);
+static inline bool
+query_user_exec(void)
+{
+ return query_user_exec_systemd();
+}
-#else /* ENABLE_SYSTEMD not defined*/
+#else /* ENABLE_SYSTEMD not defined */
/**
* Wrapper function enabling query_user_exec() if no alternative methods have
* been enabled
*
*/
-static bool
+static inline bool
query_user_exec(void)
{
return query_user_exec_builtin();
#include "config.h"
#endif
-#undef ENABLE_SYSTEMD
-/* avoid redefining ENABLE_SYSTEMD in misc.c */
-#undef HAVE_CONFIG_H
-
#include "syshead.h"
#include "manage.h"
struct management *management; /* global */
/* mocking */
+#if defined(ENABLE_SYSTEMD)
+bool
+query_user_exec_systemd(void)
+{
+ return query_user_exec_builtin();
+}
+#endif
bool
query_user_exec_builtin(void)
{