summaryrefslogtreecommitdiffstats
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-13 13:12:43 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-15 13:27:06 +0100
commit7f7d01ed5804afef220ebdb29f22d8177d0d3a5c (patch)
treea5c250f7efc1ddbf15227463ba170a4f9a2dca88 /src/core/socket.c
parentpid1: rename unit_check_gc to unit_may_gc (diff)
downloadsystemd-7f7d01ed5804afef220ebdb29f22d8177d0d3a5c.tar.xz
systemd-7f7d01ed5804afef220ebdb29f22d8177d0d3a5c.zip
pid1: include the source unit in UnitRef
No functional change. The source unit manages the reference. It allocates the UnitRef structure and registers it in the target unit, and then the reference must be destroyed before the source unit is destroyed. Thus, is should be OK to include the pointer to the source unit, it should be live as long as the reference exists. v2: - rename refs to refs_by_target
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index f3e034d2af..cb42a3eb50 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -250,7 +250,7 @@ int socket_instantiate_service(Socket *s) {
if (r < 0)
return r;
- unit_ref_set(&s->service, u);
+ unit_ref_set(&s->service, UNIT(s), u);
return unit_add_two_dependencies(UNIT(s), UNIT_BEFORE, UNIT_TRIGGERS, u, false, UNIT_DEPENDENCY_IMPLICIT);
}
@@ -377,7 +377,7 @@ static int socket_add_extras(Socket *s) {
if (r < 0)
return r;
- unit_ref_set(&s->service, x);
+ unit_ref_set(&s->service, u, x);
}
r = unit_add_two_dependencies(u, UNIT_BEFORE, UNIT_TRIGGERS, UNIT_DEREF(s->service), true, UNIT_DEPENDENCY_IMPLICIT);