prefix, s->status);
}
-static void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix) {
+void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix) {
_cleanup_free_ char *cmd = NULL;
const char *prefix2;
void exec_command_reset_status_array(ExecCommand *c, size_t n);
void exec_command_reset_status_list_array(ExecCommand **c, size_t n);
+void exec_command_dump(ExecCommand *c, FILE *f, const char *prefix);
void exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix);
void exec_command_append_list(ExecCommand **l, ExecCommand *e);
int exec_command_set(ExecCommand *c, const char *path, ...) _sentinel_;
static void mount_dump(Unit *u, FILE *f, const char *prefix) {
Mount *m = ASSERT_PTR(MOUNT(u));
MountParameters *p;
+ const char *prefix2;
assert(f);
+ prefix = strempty(prefix);
+ prefix2 = strjoina(prefix, "\t");
+
p = get_mount_parameters(m);
fprintf(f,
exec_context_dump(&m->exec_context, f, prefix);
kill_context_dump(&m->kill_context, f, prefix);
cgroup_context_dump(UNIT(m), f, prefix);
+
+ for (MountExecCommand c = 0; c < _MOUNT_EXEC_COMMAND_MAX; c++) {
+ if (!m->exec_command[c].argv)
+ continue;
+
+ fprintf(f, "%s%s %s:\n",
+ prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), mount_exec_command_to_string(c));
+
+ exec_command_dump(m->exec_command + c, f, prefix2);
+ }
}
static int mount_spawn(Mount *m, ExecCommand *c, PidRef *ret_pid) {
static void swap_dump(Unit *u, FILE *f, const char *prefix) {
Swap *s = ASSERT_PTR(SWAP(u));
SwapParameters *p;
+ const char *prefix2;
assert(f);
+ prefix = strempty(prefix);
+ prefix2 = strjoina(prefix, "\t");
+
if (s->from_proc_swaps)
p = &s->parameters_proc_swaps;
else if (s->from_fragment)
exec_context_dump(&s->exec_context, f, prefix);
kill_context_dump(&s->kill_context, f, prefix);
cgroup_context_dump(UNIT(s), f, prefix);
+
+ for (SwapExecCommand c = 0; c < _SWAP_EXEC_COMMAND_MAX; c++) {
+ if (!s->exec_command[c].argv)
+ continue;
+
+ fprintf(f, "%s%s %s:\n",
+ prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), swap_exec_command_to_string(c));
+
+ exec_command_dump(s->exec_command + c, f, prefix2);
+ }
+
}
static int swap_spawn(Swap *s, ExecCommand *c, PidRef *ret_pid) {