[systemd-commits] src/socket.c src/unit.c src/unit.h

Lennart Poettering lennart at kemper.freedesktop.org
Tue Aug 10 17:08:32 PDT 2010


 src/socket.c |    3 +++
 src/unit.c   |    3 +++
 src/unit.h   |    2 ++
 3 files changed, 8 insertions(+)

New commits:
commit 6c073082e7e3859cb6020db8c548325f342b7ba6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 11 02:07:59 2010 +0200

    socket: disable GC for pre-allocated per-connection service until it is used

diff --git a/src/socket.c b/src/socket.c
index 7c280e0..23658ac 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -165,6 +165,7 @@ static int socket_instantiate_service(Socket *s) {
         if (r < 0)
                 return r;
 
+        u->meta.no_gc = true;
         s->service = SERVICE(u);
         return 0;
 }
@@ -1202,6 +1203,8 @@ static void socket_enter_running(Socket *s, int cfd) {
                 s->service = NULL;
                 s->n_accepted ++;
 
+                service->meta.no_gc = false;
+
                 unit_choose_id(UNIT(service), name);
                 free(name);
 
diff --git a/src/unit.c b/src/unit.c
index 3c4bdec..881f91a 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -236,6 +236,9 @@ bool unit_check_gc(Unit *u) {
         if (UNIT_VTABLE(u)->no_gc)
                 return true;
 
+        if (u->meta.no_gc)
+                return true;
+
         if (u->meta.job)
                 return true;
 
diff --git a/src/unit.h b/src/unit.h
index 1c97e15..00e929a 100644
--- a/src/unit.h
+++ b/src/unit.h
@@ -208,6 +208,8 @@ struct Meta {
         bool in_gc_queue:1;
 
         bool sent_dbus_new_signal:1;
+
+        bool no_gc:1;
 };
 
 #include "service.h"


More information about the systemd-commits mailing list