diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-20 17:58:35 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-20 19:48:16 -0400 |
commit | 8b835fccdad78d89f9cc64f9b02059fb75ffbab1 (patch) | |
tree | cee036287462e1c2d8454f3419a671a64ee853a9 /src/core | |
parent | cf7d80a5fe549d4db11800015e02220dccec3096 (diff) |
systemd-verify: a simple tool for offline unit verification
This tool will warn about misspelt directives, unknown sections, and
non-executable commands. It will also catch the common mistake of
using Accept=yes with a non-template unit and vice versa.
https://bugs.freedesktop.org/show_bug.cgi?id=56607
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/socket.c | 9 | ||||
-rw-r--r-- | src/core/socket.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index c58a7f03ee..646887d803 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -180,9 +180,8 @@ static int socket_arm_timer(Socket *s) { socket_dispatch_timer, s); } -static int socket_instantiate_service(Socket *s) { - _cleanup_free_ char *prefix = NULL; - _cleanup_free_ char *name = NULL; +int socket_instantiate_service(Socket *s) { + _cleanup_free_ char *prefix = NULL, *name = NULL; int r; Unit *u; @@ -193,11 +192,9 @@ static int socket_instantiate_service(Socket *s) { * here. For Accept=no this is mostly a NOP since the service * is figured out at load time anyway. */ - if (UNIT_DEREF(s->service)) + if (UNIT_DEREF(s->service) || !s->accept) return 0; - assert(s->accept); - prefix = unit_name_to_prefix(UNIT(s)->id); if (!prefix) return -ENOMEM; diff --git a/src/core/socket.h b/src/core/socket.h index 39e00deea4..814a3bfabc 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -183,3 +183,5 @@ const char* socket_result_to_string(SocketResult i) _const_; SocketResult socket_result_from_string(const char *s) _pure_; const char* socket_port_type_to_string(SocketPort *p) _pure_; + +int socket_instantiate_service(Socket *s); |