t = timestamps_utc ? gmtime(&tmp) : localtime(&tmp);
debug_ptr += sprintf(CS debug_ptr,
LOGGING(millisec) ? "%02d:%02d:%02d.%03d " : "%02d:%02d:%02d ",
- t->tm_hour, t->tm_min, t->tm_sec, now.tv_usec/1000);
+ t->tm_hour, t->tm_min, t->tm_sec, (int)(now.tv_usec/1000));
}
DEBUG(D_pid)
FILE *f = fdopen(fd, "wb");
/* header only as required by RFC. only failure DSN needs to honor RET=FULL */
uschar * bound;
- transport_ctx tctx = {0};
+ transport_ctx tctx = {{0}};
DEBUG(D_deliver)
debug_printf("sending error message to: %s\n", sender_address);
transport_filter_argv = NULL; /* Just in case */
return_path = sender_address; /* In case not previously set */
{ /* Dummy transport for headers add */
- transport_ctx tctx = {0};
+ transport_ctx tctx = {{0}};
transport_instance tb = {0};
tctx.u.fd = fileno(f);
FILE *wmf = NULL;
FILE *f = fdopen(fd, "wb");
uschar * bound;
- transport_ctx tctx = {0};
+ transport_ctx tctx = {{0}};
if (warn_message_file)
if (!(wmf = Ufopen(warn_message_file, "rb")))
void
delivery_re_exec(int exec_type)
{
-uschar * s;
+uschar * where;
if (cutthrough.fd >= 0 && cutthrough.callout_hold_only)
{
sending_ip_address = cutthrough.snd_ip;
sending_port = cutthrough.snd_port;
- s = US"socketpair";
+ where = US"socketpair";
if (socketpair(AF_UNIX, SOCK_STREAM, 0, pfd) != 0)
goto fail;
- s = US"fork";
+ where = US"fork";
if ((pid = fork()) < 0)
goto fail;
cancel_cutthrough_connection(TRUE, US"non-continued delivery");
(void) child_exec_exim(exec_type, FALSE, NULL, FALSE, 2, US"-Mc", message_id);
}
-/* Control does not return here. */
+return; /* compiler quietening; control does not reach here. */
fail:
log_write(0,
LOG_MAIN | (exec_type == CEE_EXEC_EXIT ? LOG_PANIC : LOG_PANIC_DIE),
- "delivery re-exec failed: %s", strerror(errno));
+ "delivery re-exec %s failed: %s", where, strerror(errno));
/* Get here if exec_type == CEE_EXEC_EXIT.
Note: this must be _exit(), not exit(). */
int save_errno = 0;
BOOL rc;
uschar * dkim_spool_name, * dkim_signature;
-int sread = 0, wwritten = 0, siglen = 0, options;
+int siglen = 0, options;
off_t k_file_size;
const uschar * errstr;
assertion field. */
case T_CSA:
{
- uschar *srvname, *namesuff, *tld, *p;
+ uschar *srvname, *namesuff, *tld;
int priority, weight, port;
int limit, rc, i;
BOOL ipv6;
lookup_info **lookup_list;
int lookup_list_count = 0;
-static int lookup_list_init_done = 0;
-
/* Table of information about all possible authentication mechanisms. All
entries are always present if any mechanism is declared, but the functions are
set to NULL for those that are not compiled into the binary. */
int moduleerrors = 0;
#endif
struct lookupmodulestr *p;
+ static BOOL lookup_list_init_done = FALSE;
+
if (lookup_list_init_done)
return;
- lookup_list_init_done = 1;
+ lookup_list_init_done = TRUE;
#if defined(LOOKUP_CDB) && LOOKUP_CDB!=2
addlookupmodule(NULL, &cdb_lookup_module_info);
os_restarting_signal(sig, usr1_handler);
-fd = Uopen(process_log_path, O_APPEND|O_WRONLY, LOG_MODE);
-if (fd < 0)
+if ((fd = Uopen(process_log_path, O_APPEND|O_WRONLY, LOG_MODE)) < 0)
{
/* If we are already running as the Exim user, try to create it in the
current process (assuming spool_directory exists). Otherwise, if we are
int dummy;
(void)directory_make(spool_directory, US"", SPOOL_DIRECTORY_MODE, FALSE);
dummy = /* quieten compiler */ Uchdir(spool_directory);
+ dummy = dummy; /* yet more compiler quietening, sigh */
}
/* Handle calls with the -bi option. This is a sendmail option to rebuild *the*
{
case MSG_SHOW_COPY:
{
- transport_ctx tctx = {0};
+ transport_ctx tctx = {{0}};
deliver_in_buffer = store_malloc(DELIVER_IN_BUFFER_SIZE);
deliver_out_buffer = store_malloc(DELIVER_OUT_BUFFER_SIZE);
tctx.u.fd = 1;
{ "write_rejectlog", opt_bool, &write_rejectlog }
};
+#ifndef MACRO_PREDEF
static int optionlist_config_size = nelem(optionlist_config);
+#endif
#ifdef MACRO_PREDEF
for (ai = auths_available; ai->driver_name[0]; ai++)
{
- spf(buf, sizeof(buf), "_DRIVER_AUTHENTICATOR_%T", ai->driver_name);
+ spf(buf, sizeof(buf), US"_DRIVER_AUTHENTICATOR_%T", ai->driver_name);
builtin_macro_create(buf);
options_from_list(ai->options, (unsigned)*ai->options_count, US"AUTHENTICATOR", ai->driver_name);
}
this operates on a global (static) list that holds all the pre-parsed
config lines, we do no further processing here, output formatting and
honouring of <hide> or macros will be done during output */
+
static void
save_config_line(const uschar* line)
{
last_rule = last_rule->next);
DEBUG(D_retry)
debug_printf(" received_time=%d diff=%d timeout=%d\n",
- received_time.tv_sec, (int)(now - received_time.tv_sec), last_rule->timeout);
+ (int)received_time.tv_sec, (int)(now - received_time.tv_sec), last_rule->timeout);
address_timeout = (now - received_time.tv_sec > last_rule->timeout);
}
else
for (ri = routers_available; ri->driver_name[0]; ri++)
{
- spf(buf, sizeof(buf), "_DRIVER_ROUTER_%T", ri->driver_name);
+ spf(buf, sizeof(buf), US"_DRIVER_ROUTER_%T", ri->driver_name);
builtin_macro_create(buf);
options_from_list(ri->options, (unsigned)*ri->options_count, US"ROUTER", ri->driver_name);
}
int accept_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
int dnslookup_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
int ipliteral_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
int iplookup_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
int manualroute_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
int queryprogram_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
int redirect_router_entry(router_instance *rblock, address_item *addr,
struct passwd *pw, int verify, address_item **addr_local,
address_item **addr_remote, address_item **addr_new,
- address_item **addr_succeed) {}
+ address_item **addr_succeed) {return 0;}
#else /*!MACRO_PREDEF*/
mbox_path = string_sprintf("%s/scan/%s", spool_directory, spooled_message_id);
- tempdir = opendir(CS mbox_path);
- if (!tempdir)
+ if (!(tempdir = opendir(CS mbox_path)))
{
debug_printf("Unable to opendir(%s): %s\n", mbox_path, strerror(errno));
/* Just in case we still can: */
return;
}
/* loop thru dir & delete entries */
- while((entry = readdir(tempdir)) != NULL)
+ while((entry = readdir(tempdir)))
{
uschar *name = US entry->d_name;
int dummy;
file_path = string_sprintf("%s/%s", mbox_path, name);
debug_printf("unspool_mbox(): unlinking '%s'\n", file_path);
- dummy = unlink(CS file_path);
+ dummy = unlink(CS file_path); dummy = dummy; /* compiler quietening */
}
closedir(tempdir);
fprintf(f, "%.63s %ld %ld\n", originator_login, (long int)originator_uid,
(long int)originator_gid);
fprintf(f, "<%s>\n", sender_address);
-fprintf(f, "%d %d\n", received_time.tv_sec, warning_count);
+fprintf(f, "%d %d\n", (int)received_time.tv_sec, warning_count);
-fprintf(f, "-received_time_usec .%06d\n", received_time.tv_usec);
+fprintf(f, "-received_time_usec .%06d\n", (int)received_time.tv_usec);
/* If there is information about a sending host, remember it. The HELO
data can be set for local SMTP as well as remote. */
break;
case tod_log_datestamp_monthly:
+#ifndef COMPILE_UTILITY
off = sprintf(CS timebuf, "%04d%02d",
1900 + t->tm_year, 1 + t->tm_mon);
+#endif
break;
#endif
(void) sprintf(CS timebuf,
"%04d-%02d-%02d %02d:%02d:%02d.%03d %+03d%02d",
1900 + local.tm_year, 1 + local.tm_mon, local.tm_mday,
- local.tm_hour, local.tm_min, local.tm_sec, now.tv_usec/1000,
+ local.tm_hour, local.tm_min, local.tm_sec, (int)(now.tv_usec/1000),
diff_hour, diff_min);
else
#endif
#ifndef COMPILE_UTILITY
if (LOGGING(millisec) && off > 0)
- (void) sprintf(CS timebuf + off, ".%03d", now.tv_usec/1000);
+ (void) sprintf(CS timebuf + off, ".%03d", (int)(now.tv_usec/1000));
+#else
+off = off; /* Compiler quietening */
#endif
return timebuf;
for (ti = transports_available; ti->driver_name[0]; ti++)
{
- spf(buf, sizeof(buf), "_DRIVER_TRANSPORT_%T", ti->driver_name);
+ spf(buf, sizeof(buf), US"_DRIVER_TRANSPORT_%T", ti->driver_name);
builtin_macro_create(buf);
options_from_list(ti->options, (unsigned)*ti->options_count, US"TRANSPORT", ti->driver_name);
}
BOOL
transport_write_string(int fd, const char *format, ...)
{
-transport_ctx tctx = {0};
+transport_ctx tctx = {{0}};
va_list ap;
va_start(ap, format);
if (!string_vformat(big_buffer, big_buffer_size, format, ap))
int rc, len, yield, fd_read, fd_write, save_errno;
int pfd[2] = {-1, -1};
pid_t filter_pid, write_pid;
-static transport_ctx dummy_tctx = {0};
transport_filter_timed_out = FALSE;
int dummy = read(pfd[pipe_read], (void *)&save_errno, sizeof(int));
dummy = read(pfd[pipe_read], (void *)&tctx->addr->more_errno, sizeof(int));
dummy = read(pfd[pipe_read], (void *)&tctx->addr->delivery_usec, sizeof(int));
+ dummy = dummy; /* compiler quietening */
yield = FALSE;
}
}
int used;
off_t size;
struct stat statbuf;
-transport_ctx tctx = {0};
+transport_ctx tctx = {{0}};
tctx.u.fd = to_fd;
if (yield == OK)
{
transport_ctx tctx = {
- fd,
+ {fd},
tblock,
addr,
ob->check_string,
:
US"------ This is a copy of the message, including all the headers.\n";
transport_ctx tctx = {
- fileno(f),
+ {fileno(f)},
tblock,
addr,
NULL, NULL,
{
BOOL ok;
transport_ctx tctx = {
- fd_in,
+ {fd_in},
tblock,
addrlist,
US".", US"..",
uschar *cmd, *ss;
uschar *eol = ob->use_crlf ? US"\r\n" : US"\n";
transport_ctx tctx = {
- 0,
+ {0},
tblock,
addr,
ob->check_string,
If one is found, attempt to authenticate by calling its client function.
*/
- for (au = auths; !smtp_authenticated && au != NULL; au = au->next)
+ for (au = auths; !smtp_authenticated && au; au = au->next)
{
uschar *p = names;
if (!au->client ||
/* Loop to scan supported server mechanisms */
- while (*p != 0)
+ while (*p)
{
int rc;
int len = Ustrlen(au->public_name);
BOOL pass_message = FALSE;
uschar *message = NULL;
uschar new_message_id[MESSAGE_ID_LENGTH + 1];
-uschar *p;
smtp_context sx;
else
{
transport_ctx tctx = {
- sx.inblock.sock,
+ {sx.inblock.sock},
tblock,
addrlist,
US".", US"..", /* Escaping strings */