BOOL deliver_firsttime = FALSE;
BOOL deliver_freeze = FALSE;
-int deliver_frozen_at = 0;
+time_t deliver_frozen_at = 0;
BOOL deliver_manual_thaw = FALSE;
#ifndef DISABLE_DKIM
/* Time on queue and actual time taken to deliver */
if ((log_extra_selector & LX_queue_time) != 0)
- {
s = string_append(s, &size, &ptr, 2, US" QT=",
- readconf_printtime(time(NULL) - received_time));
- }
+ readconf_printtime( (int) ((long)time(NULL) - (long)received_time)) );
if ((log_extra_selector & LX_deliver_time) != 0)
- {
s = string_append(s, &size, &ptr, 2, US" DT=",
readconf_printtime(addr->more_errno));
- }
/* string_cat() always leaves room for the terminator. Release the
store we used to build the line after writing it. */
DEBUG(D_deliver) debug_printf("sending error message to: %s\n", sender_address);
/* build unique id for MIME boundary */
- snprintf(boundaryStr, 63, "%l-eximdsn-%d", (long) time(NULL), rand());
+ snprintf(boundaryStr, sizeof(boundaryStr)-1, TIME_T_FMT "-eximdsn-%d",
+ time(NULL), rand());
DEBUG(D_deliver) debug_printf("DSN: MIME boundary: %s\n", boundaryStr);
if (errors_reply_to != NULL) fprintf(f,"Reply-To: %s\n", errors_reply_to);
if ((log_extra_selector & LX_queue_time_overall) != 0)
log_write(0, LOG_MAIN, "Completed QT=%s",
- readconf_printtime(time(NULL) - received_time));
+ readconf_printtime( (int) ((long)time(NULL) - (long)received_time)) );
else
log_write(0, LOG_MAIN, "Completed");
/* Generate the contents of the history file */
history_buffer = string_sprintf("job %s\n", message_id);
history_buffer = string_sprintf("%sreporter %s\n", history_buffer, primary_hostname);
- history_buffer = string_sprintf("%sreceived %ld\n", history_buffer, time(NULL));
+ history_buffer = string_sprintf("%sreceived " TIME_T_FMT "\n", history_buffer, time(NULL));
history_buffer = string_sprintf("%sipaddr %s\n", history_buffer, sender_host_address);
history_buffer = string_sprintf("%sfrom %s\n", history_buffer, header_from_sender);
history_buffer = string_sprintf("%smfrom %s\n", history_buffer,
int hd = -1;
int md = -1;
int yield = 0;
-int now = time(NULL);
+time_t now = time(NULL);
BOOL use_lockfile = FALSE;
BOOL use_fcntl = FALSE;
BOOL use_flock = FALSE;
lockname = malloc(len + 8);
sprintf(lockname, "%s.lock", filename);
hitchname = malloc(len + 32 + (int)strlen(primary_hostname));
+
+ /* Presumably, this must match appendfile.c */
sprintf(hitchname, "%s.%s.%08x.%08x", lockname, primary_hostname,
- now, (int)getpid());
+ (unsigned int)now, (unsigned int)getpid());
if (verbose)
printf("exim_lock: lockname = %s\n hitchname = %s\n", lockname,
BOOL deliver_firsttime = FALSE;
BOOL deliver_force = FALSE;
BOOL deliver_freeze = FALSE;
-int deliver_frozen_at = 0;
+time_t deliver_frozen_at = 0;
uschar *deliver_home = NULL;
uschar *deliver_host = NULL;
uschar *deliver_host_address = NULL;
extern BOOL deliver_firsttime; /* True for first delivery attempt */
extern BOOL deliver_force; /* TRUE if delivery was forced */
extern BOOL deliver_freeze; /* TRUE if delivery is frozen */
-extern int deliver_frozen_at; /* Time of freezing */
+extern time_t deliver_frozen_at; /* Time of freezing */
extern uschar *deliver_home; /* Home directory for pipes */
extern uschar *deliver_host; /* (First) host for routed local deliveries */
/* Remote host for filter */
{
fd_set select_inset;
struct timeval tv;
-int start_recv = time(NULL);
+time_t start_recv = time(NULL);
int rc;
/* Wait until the socket is ready */
if (s != NULL) s[ptr] = 0; else s = US"";
log_write(0, LOG_MAIN, "no MAIL in SMTP connection from %s D=%s%s",
host_and_ident(FALSE),
- readconf_printtime(time(NULL) - smtp_connection_start), s);
+ readconf_printtime( (int) ((long)time(NULL) - (long)smtp_connection_start)),
+ s);
}
if (Ustrncmp(p, "rozen", 5) == 0)
{
deliver_freeze = TRUE;
- deliver_frozen_at = Uatoi(big_buffer + 7);
+ sscanf(big_buffer+7, TIME_T_FMT, &deliver_frozen_at);
}
break;
if (allow_unqualified_recipient) fprintf(f, "-allow_unqualified_recipient\n");
if (allow_unqualified_sender) fprintf(f, "-allow_unqualified_sender\n");
if (deliver_firsttime) fprintf(f, "-deliver_firsttime\n");
-if (deliver_freeze) fprintf(f, "-frozen %d\n", deliver_frozen_at);
+if (deliver_freeze) fprintf(f, "-frozen " TIME_T_FMT "\n", deliver_frozen_at);
if (dont_deliver) fprintf(f, "-N\n");
if (host_lookup_deferred) fprintf(f, "-host_lookup_deferred\n");
if (host_lookup_failed) fprintf(f, "-host_lookup_failed\n");
else if (type == tod_epoch)
{
- (void) sprintf(CS timebuf, "%d", (int)now); /* Unix epoch format */
- return timebuf;
+ (void) sprintf(CS timebuf, TIME_T_FMT, now); /* Unix epoch format */
+ return timebuf; /* NB the above will be wrong if time_t is FP */
}
else if (type == tod_zulu)
if (ob->use_lockfile)
{
+ /* cf. exim_lock.c */
lockname = string_sprintf("%s.lock", filename);
hitchname = string_sprintf( "%s.%s.%08x.%08x", lockname, primary_hostname,
(unsigned int)(time(NULL)), (unsigned int)getpid());