projects
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
periodic queue runner
[exim.git]
/
src
/
src
/
daemon.c
diff --git
a/src/src/daemon.c
b/src/src/daemon.c
index 24874c374f0a9f8d5d61b69eea8eadf7075c2cac..60ef3377331efa506a48b2b036f3667b1653ffbc 100644
(file)
--- a/
src/src/daemon.c
+++ b/
src/src/daemon.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
5
*/
+/* Copyright (c) University of Cambridge 1995 - 201
6
*/
/* See the file NOTICE for conditions of use and distribution. */
/* Functions concerned with running Exim as a daemon */
/* See the file NOTICE for conditions of use and distribution. */
/* Functions concerned with running Exim as a daemon */
@@
-927,13
+927,12
@@
if (inetd_wait_mode)
int on = 1;
listen_socket_count = 1;
int on = 1;
listen_socket_count = 1;
- listen_sockets = store_get(sizeof(int
*
));
+ listen_sockets = store_get(sizeof(int));
(void) close(3);
if (dup2(0, 3) == -1)
(void) close(3);
if (dup2(0, 3) == -1)
- {
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
"failed to dup inetd socket safely away: %s", strerror(errno));
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
"failed to dup inetd socket safely away: %s", strerror(errno));
- }
+
listen_sockets[0] = 3;
(void) close(0);
(void) close(1);
listen_sockets[0] = 3;
(void) close(0);
(void) close(1);
@@
-957,8
+956,10
@@
if (inetd_wait_mode)
/* As per below, when creating sockets ourselves, we handle tcp_nodelay for
our own buffering; we assume though that inetd set the socket REUSEADDR. */
/* As per below, when creating sockets ourselves, we handle tcp_nodelay for
our own buffering; we assume though that inetd set the socket REUSEADDR. */
- if (tcp_nodelay) setsockopt(3, IPPROTO_TCP, TCP_NODELAY,
- (uschar *)(&on), sizeof(on));
+ if (tcp_nodelay)
+ if (setsockopt(3, IPPROTO_TCP, TCP_NODELAY, US &on, sizeof(on)))
+ log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to set socket NODELAY: %s",
+ strerror(errno));
}
}
@@
-1097,11
+1098,11
@@
if (daemon_listen && !inetd_wait_mode)
{
joinstr[0] = sep;
joinstr[1] = ' ';
{
joinstr[0] = sep;
joinstr[1] = ' ';
- *ptr = string_cat(*ptr, sizeptr, ptrptr, US"<", 1);
+ *ptr = string_cat
n
(*ptr, sizeptr, ptrptr, US"<", 1);
}
}
- *ptr = string_cat(*ptr, sizeptr, ptrptr, joinstr, 2);
- *ptr = string_cat
(*ptr, sizeptr, ptrptr, s, Ustrlen(s)
);
+ *ptr = string_cat
n
(*ptr, sizeptr, ptrptr, joinstr, 2);
+ *ptr = string_cat
(*ptr, sizeptr, ptrptr, s
);
}
if (new_smtp_port != NULL)
}
if (new_smtp_port != NULL)
@@
-1276,7
+1277,7
@@
if (daemon_listen && !inetd_wait_mode)
for (ipa = addresses; ipa != NULL; ipa = ipa->next)
listen_socket_count++;
for (ipa = addresses; ipa != NULL; ipa = ipa->next)
listen_socket_count++;
- listen_sockets = store_get(sizeof(int
*
) * listen_socket_count);
+ listen_sockets = store_get(sizeof(int) * listen_socket_count);
} /* daemon_listen but not inetd_wait_mode */
} /* daemon_listen but not inetd_wait_mode */
@@
-1381,8
+1382,7
@@
if (daemon_listen && !inetd_wait_mode)
wildcard = ipa->address[0] == 0;
}
wildcard = ipa->address[0] == 0;
}
- listen_sockets[sk] = ip_socket(SOCK_STREAM, af);
- if (listen_sockets[sk] < 0)
+ if ((listen_sockets[sk] = ip_socket(SOCK_STREAM, af)) < 0)
{
if (check_special_case(0, addresses, ipa, FALSE))
{
{
if (check_special_case(0, addresses, ipa, FALSE))
{
@@
-1705,7
+1705,6
@@
else
/* Do any work it might be useful to amortize over our children
(eg: compile regex) */
/* Do any work it might be useful to amortize over our children
(eg: compile regex) */
-deliver_init();
dns_pattern_init();
#ifdef WITH_CONTENT_SCAN
dns_pattern_init();
#ifdef WITH_CONTENT_SCAN
@@
-1836,7
+1835,10
@@
for (;;)
if (deliver_force_thaw) *p++ = 'f';
if (queue_run_local) *p++ = 'l';
*p = 0;
if (deliver_force_thaw) *p++ = 'f';
if (queue_run_local) *p++ = 'l';
*p = 0;
- extra[0] = opt;
+ if (queue_name)
+ extra[0] = string_sprintf("%sG%s", opt, queue_name);
+ else
+ extra[0] = opt;
/* If -R or -S were on the original command line, ensure they get
passed on. */
/* If -R or -S were on the original command line, ensure they get
passed on. */