summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 358556c)
raw | patch | inline | side by side (parent: 358556c)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 21 Apr 2007 09:38:29 +0000 (11:38 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 21 Apr 2007 09:38:29 +0000 (11:38 +0200) |
It was only caused when run in DS-only-mode.
src/email.c | patch | blob | history |
diff --git a/src/email.c b/src/email.c
index eed91f170cc1c16639acf47f084975127132f9cc..7738a39b3727a8f2b14a6382524e5f07f3b832a6 100644 (file)
--- a/src/email.c
+++ b/src/email.c
static pthread_cond_t collector_available = PTHREAD_COND_INITIALIZER;
/* collector threads */
-static collector_t **collectors;
+static collector_t **collectors = NULL;
static pthread_mutex_t available_mutex = PTHREAD_MUTEX_INITIALIZER;
static int available_collectors;
{
int i = 0;
- if (disabled)
- return (0);
-
if (connector != ((pthread_t) 0)) {
pthread_kill (connector, SIGTERM);
connector = (pthread_t) 0;
/* don't allow any more connections to be processed */
pthread_mutex_lock (&conns_mutex);
- for (i = 0; i < max_conns; ++i) {
- if (collectors[i]->thread != ((pthread_t) 0)) {
- pthread_kill (collectors[i]->thread, SIGTERM);
- collectors[i]->thread = (pthread_t) 0;
- }
-
- if (collectors[i]->socket >= 0) {
- close (collectors[i]->socket);
- collectors[i]->socket = -1;
+ if (collectors != NULL) {
+ for (i = 0; i < max_conns; ++i) {
+ if (collectors[i] == NULL)
+ continue;
+
+ if (collectors[i]->thread != ((pthread_t) 0)) {
+ pthread_kill (collectors[i]->thread, SIGTERM);
+ collectors[i]->thread = (pthread_t) 0;
+ }
+
+ if (collectors[i]->socket >= 0) {
+ close (collectors[i]->socket);
+ collectors[i]->socket = -1;
+ }
}
- }
+ } /* if (collectors != NULL) */
pthread_mutex_unlock (&conns_mutex);
unlink (SOCK_PATH);
+ errno = 0;
return (0);
} /* static void email_shutdown (void) */