]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: service_signal() reimplemented using the service process linked list.
authorTimo Sirainen <tss@iki.fi>
Mon, 19 Oct 2009 22:34:00 +0000 (18:34 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 19 Oct 2009 22:34:00 +0000 (18:34 -0400)
--HG--
branch : HEAD

src/master/service.c

index 91469d0c1703a71a1d114fe74ac163f1c8b5c35a..0c186482796462a491e58a1be3a3846ba5b90ff9 100644 (file)
@@ -447,22 +447,16 @@ int services_create(const struct master_settings *set,
 
 void service_signal(struct service *service, int signo)
 {
-       struct hash_iterate_context *iter;
-       void *key, *value;
-
-       iter = hash_table_iterate_init(service_pids);
-       while (hash_table_iterate(iter, &key, &value)) {
-               struct service_process *process = value;
+       struct service_process *process = service->processes;
 
-               if (process->service != service)
-                       continue;
+       for (; process != NULL; process = process->next) {
+               i_assert(process->service == service);
 
                if (kill(process->pid, signo) < 0 && errno != ESRCH) {
                        service_error(service, "kill(%s, %d) failed: %m",
                                      dec2str(process->pid), signo);
                }
        }
-       hash_table_iterate_deinit(&iter);
 }
 
 static void services_kill_timeout(struct service_list *service_list)