summaryrefslogtreecommitdiff
path: root/src/service.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-06 23:08:54 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-06 23:08:54 +0100
commit57020a3abff20f176e9f0cbb982d7977119d6f08 (patch)
tree3b3d69307cecce0dc4ad25aa074c2a0db64bdfb6 /src/service.h
parent73aa0c00df8b101bad4c3a038148a633df88610c (diff)
unit: properly update references to units which are merged
When we merge units that some kind of object points to, those pointers might become invalidated, and needs to be updated. Introduce a UnitRef struct which links up all the unit references, to ensure corrected references. At the same time, drop configured_sockets in the Service object, and replace it by proper UNIT_TRIGGERS resp. UNIT_TRIGGERED_BY dependencies, which allow us to simplify a lot of code.
Diffstat (limited to 'src/service.h')
-rw-r--r--src/service.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/service.h b/src/service.h
index 2102826723..8f67ad50a8 100644
--- a/src/service.h
+++ b/src/service.h
@@ -27,6 +27,7 @@ typedef struct Service Service;
#include "unit.h"
#include "path.h"
#include "ratelimit.h"
+#include "service.h"
typedef enum ServiceState {
SERVICE_DEAD,
@@ -154,8 +155,7 @@ struct Service {
RateLimit ratelimit;
- struct Socket *accept_socket;
- Set *configured_sockets;
+ UnitRef accept_socket;
Watch timer_watch;
PathSpec *pid_file_pathspec;
@@ -165,6 +165,8 @@ struct Service {
extern const UnitVTable service_vtable;
+struct Socket;
+
int service_set_socket_fd(Service *s, int fd, struct Socket *socket);
const char* service_state_to_string(ServiceState i);