summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 02:16:27 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 02:16:27 +0100
commitc43d20a0af915a2641e9645ba7f47f576f9075e3 (patch)
treed8f21a3e1d6c2a7fdde2d0758c3a71c0fa9df7f3
parent1c01f82badb17d4868c3096542dff0a53b8f4782 (diff)
improve dump output for sockets
-rw-r--r--socket.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/socket.c b/socket.c
index 3d02f41411..1b23483881 100644
--- a/socket.c
+++ b/socket.c
@@ -135,9 +135,14 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
SocketExecCommand c;
Socket *s = SOCKET(u);
SocketPort *p;
+ char *prefix2;
assert(s);
+ prefix2 = strappend(prefix, "\t");
+ if (!prefix2)
+ prefix2 = "";
+
fprintf(f,
"%sSocket State: %s\n"
"%sBindIPv6Only: %s\n"
@@ -167,11 +172,16 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
exec_context_dump(&s->exec_context, f, prefix);
for (c = 0; c < _SOCKET_EXEC_MAX; c++) {
- ExecCommand *i;
+ if (!s->exec_command[c])
+ continue;
- LIST_FOREACH(command, i, s->exec_command[c])
- fprintf(f, "%s%s: %s\n", prefix, command_table[c], i->path);
+ fprintf(f, "%s→ %s:\n",
+ prefix, command_table[c]);
+
+ exec_command_dump_list(s->exec_command[c], f, prefix2);
}
+
+ free(prefix2);
}
static void socket_close_fds(Socket *s) {