]> err.no Git - systemd/commitdiff
socket: disable GC for pre-allocated per-connection service until it is used
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 00:07:59 +0000 (02:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 00:07:59 +0000 (02:07 +0200)
src/socket.c
src/unit.c
src/unit.h

index 7c280e0067bb1d6a30963db123cedb47fc8c2501..23658ac274a2343e0bb6ed7455e9d9954022b18f 100644 (file)
@@ -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);
 
index 3c4bdec9816dfd8af6a4de3216f6ed3ea29dae33..881f91a677880a30fb1728f98373393c748d29f1 100644 (file)
@@ -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;
 
index 1c97e158fc3dd2e93c0996619abe70338f2650d5..00e929ac4e21e3fa8ed1b3b8e6d1e6eee04f9783 100644 (file)
@@ -208,6 +208,8 @@ struct Meta {
         bool in_gc_queue:1;
 
         bool sent_dbus_new_signal:1;
+
+        bool no_gc:1;
 };
 
 #include "service.h"