dovecot-2.0-sslstream: master: Keep service's processes in an ea...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Feb 13 02:55:14 EET 2010
details: http://hg.dovecot.org/dovecot-2.0-sslstream/rev/fea8122e1deb
changeset: 10100:fea8122e1deb
user: Timo Sirainen <tss at iki.fi>
date: Mon Oct 19 18:31:46 2009 -0400
description:
master: Keep service's processes in an easily accessible linked list.
diffstat:
3 files changed, 7 insertions(+), 1 deletion(-)
src/master/service-process.c | 5 ++++-
src/master/service-process.h | 1 +
src/master/service.h | 2 ++
diffs (52 lines):
diff -r 15a71c18a0f8 -r fea8122e1deb src/master/service-process.c
--- a/src/master/service-process.c Mon Oct 19 15:02:04 2009 -0400
+++ b/src/master/service-process.c Mon Oct 19 18:31:46 2009 -0400
@@ -10,6 +10,7 @@
#include "base64.h"
#include "hash.h"
#include "str.h"
+#include "llist.h"
#include "hostpid.h"
#include "env-util.h"
#include "fd-close-on-exec.h"
@@ -566,7 +567,8 @@ service_process_create(struct service *s
i_assert(fd[0] == -1);
break;
}
-
+
+ DLLIST_PREPEND(&service->processes, process);
process->refcount = 1;
process->pid = pid;
process->uid = uid;
@@ -588,6 +590,7 @@ void service_process_destroy(struct serv
struct service *service = process->service;
struct service_list *service_list = service->list;
+ DLLIST_REMOVE(&service->processes, process);
hash_table_remove(service_pids, &process->pid);
if (process->available_count > 0)
diff -r 15a71c18a0f8 -r fea8122e1deb src/master/service-process.h
--- a/src/master/service-process.h Mon Oct 19 15:02:04 2009 -0400
+++ b/src/master/service-process.h Mon Oct 19 18:31:46 2009 -0400
@@ -2,6 +2,7 @@
#define SERVICE_PROCESS_H
struct service_process {
+ struct service_process *prev, *next;
struct service *service;
int refcount;
diff -r 15a71c18a0f8 -r fea8122e1deb src/master/service.h
--- a/src/master/service.h Mon Oct 19 15:02:04 2009 -0400
+++ b/src/master/service.h Mon Oct 19 18:31:46 2009 -0400
@@ -62,6 +62,8 @@ struct service {
/* all listeners, even those that aren't currently listening */
ARRAY_DEFINE(listeners, struct service_listener *);
+ /* linked list of all processes belonging to this service */
+ struct service_process *processes;
/* number of processes currently created for this service */
unsigned int process_count;
More information about the dovecot-cvs
mailing list