#include "chase.h"
#include "env-util.h"
#include "escape.h"
+#include "exec-util.h"
#include "exit-status.h"
#include "fd-util.h"
#include "format-util.h"
if (r < 0)
return bus_log_create_error(r);
- if (use_ex_prop)
- r = sd_bus_message_append_strv(
- m,
- STRV_MAKE(arg_expand_environment > 0 ? NULL : "no-env-expand",
- arg_ignore_failure ? "ignore-failure" : NULL));
- else
+ if (use_ex_prop) {
+ _cleanup_strv_free_ char **opts = NULL;
+
+ r = exec_command_flags_to_strv(
+ (arg_expand_environment > 0 ? 0 : EXEC_COMMAND_NO_ENV_EXPAND)|(arg_ignore_failure ? EXEC_COMMAND_IGNORE_FAILURE : 0),
+ &opts);
+ if (r < 0)
+ return log_error_errno(r, "Failed to format execute flags: %m");
+
+ r = sd_bus_message_append_strv(m, opts);
+ } else
r = sd_bus_message_append(m, "b", arg_ignore_failure);
if (r < 0)
return bus_log_create_error(r);