diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2011-08-29 21:43:10 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2011-08-29 21:43:10 +0000 |
commit | bdbf27829b9a3d91a783816ef1652030405644c9 (patch) | |
tree | 1038f1d0de51d726a44718156af8e44ee3b6df5d | |
parent | 08872065a616a8d6ab27c539c0f9c9a02e5850bf (diff) |
cast all printed time_t to long long int, and change format string accordingly.
ok gilles@
-rw-r--r-- | usr.sbin/smtpd/enqueue.c | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/mda.c | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/mta.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/queue_shared.c | 8 | ||||
-rw-r--r-- | usr.sbin/smtpd/runner.c | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 5 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 5 |
7 files changed, 23 insertions, 20 deletions
diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c index ca79b867d2d..989a21521ca 100644 --- a/usr.sbin/smtpd/enqueue.c +++ b/usr.sbin/smtpd/enqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enqueue.c,v 1.46 2011/08/29 18:49:29 chl Exp $ */ +/* $OpenBSD: enqueue.c,v 1.47 2011/08/29 21:43:08 chl Exp $ */ /* * Copyright (c) 2005 Henning Brauer <henning@bulabula.org> @@ -558,8 +558,8 @@ enqueue_offline(int argc, char *argv[]) FILE *fp; int i, fd, ch; - if (! bsnprintf(path, sizeof(path), "%s%s/%d.XXXXXXXXXX", PATH_SPOOL, - PATH_OFFLINE, time(NULL))) + if (! bsnprintf(path, sizeof(path), "%s%s/%lld.XXXXXXXXXX", PATH_SPOOL, + PATH_OFFLINE, (long long int) time(NULL))) err(1, "snprintf"); if ((fd = mkstemp(path)) == -1 || (fp = fdopen(fd, "w+")) == NULL) { diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c index 2d267508400..9f3dd26e0af 100644 --- a/usr.sbin/smtpd/mda.c +++ b/usr.sbin/smtpd/mda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mda.c,v 1.58 2011/08/29 18:49:29 chl Exp $ */ +/* $OpenBSD: mda.c,v 1.59 2011/08/29 21:43:08 chl Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -218,9 +218,9 @@ mda_imsg(struct imsgev *iev, struct imsg *imsg) /* log status */ if (error && asprintf(&error, "Error (%s)", error) < 0) fatal("mda: asprintf"); - log_info("%016llx: to=<%s@%s>, delay=%d, stat=%s", + log_info("%016llx: to=<%s@%s>, delay=%lld, stat=%s", s->msg.delivery.id, maddr->user, maddr->domain, - time(NULL) - s->msg.delivery.creation, + (long long int) (time(NULL) - s->msg.delivery.creation), error ? error : "Sent"); free(error); diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 20b884ca9df..70ac092fd4b 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.112 2011/08/29 18:49:29 chl Exp $ */ +/* $OpenBSD: mta.c,v 1.113 2011/08/29 21:43:09 chl Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -697,9 +697,10 @@ mta_message_log(struct mta_session *s, struct envelope *e) struct mta_relay *relay = TAILQ_FIRST(&s->relays); char *status = e->delivery.errorline; - log_info("%016llx: to=<%s@%s>, delay=%d, relay=%s [%s], stat=%s (%s)", + log_info("%016llx: to=<%s@%s>, delay=%lld, relay=%s [%s], stat=%s (%s)", e->delivery.id, e->delivery.rcpt.user, - e->delivery.rcpt.domain, time(NULL) - e->delivery.creation, + e->delivery.rcpt.domain, + (long long int) (time(NULL) - e->delivery.creation), relay ? relay->fqdn : "(none)", relay ? ss_to_text(&relay->sa) : "", *status == '2' ? "Sent" : diff --git a/usr.sbin/smtpd/queue_shared.c b/usr.sbin/smtpd/queue_shared.c index bfa4e818b59..726a63f6359 100644 --- a/usr.sbin/smtpd/queue_shared.c +++ b/usr.sbin/smtpd/queue_shared.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_shared.c,v 1.50 2011/08/28 22:20:27 chl Exp $ */ +/* $OpenBSD: queue_shared.c,v 1.51 2011/08/29 21:43:09 chl Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -330,13 +330,13 @@ display_envelope(struct envelope *e, int flags) printf("UNKNOWN"); } - printf("|%016llx|%s|%s@%s|%s@%s|%d|%d|%u", + printf("|%016llx|%s|%s@%s|%s@%s|%lld|%lld|%u", e->delivery.id, status, e->delivery.from.user, e->delivery.from.domain, e->delivery.rcpt.user, e->delivery.rcpt.domain, - e->delivery.lasttry, - e->delivery.expire, + (long long int) e->delivery.lasttry, + (long long int) e->delivery.expire, e->delivery.retry); if (e->delivery.errorline[0] != '\0') diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index 344d7662dec..08274989778 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.114 2011/08/29 18:49:29 chl Exp $ */ +/* $OpenBSD: runner.c,v 1.115 2011/08/29 21:43:09 chl Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -348,8 +348,8 @@ runner_timeout(int fd, short event, void *p) nsched = 0; } - log_debug("runner: nothing to do for the next %d seconds, zZzZzZ", - nsched); + log_debug("runner: nothing to do for the next %lld seconds, zZzZzZ", + (long long int) nsched); tv.tv_sec = nsched; tv.tv_usec = 0; diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 0ea3c5eec8a..1eda752cbc1 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.64 2011/08/26 14:39:47 chl Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.65 2011/08/29 21:43:09 chl Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -323,7 +323,8 @@ show_stats_output(struct imsg *imsg) printf("lka.queries.cname=%zd\n", stats->lka.queries_cname); printf("lka.queries.failure=%zd\n", stats->lka.queries_failure); - printf("parent.uptime=%d\n", time(NULL) - stats->parent.start); + printf("parent.uptime=%lld\n", + (long long int) (time(NULL) - stats->parent.start)); printf("queue.inserts.local=%zd\n", stats->queue.inserts_local); printf("queue.inserts.remote=%zd\n", stats->queue.inserts_remote); diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 5c5412818a7..ddd27ea2270 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.128 2011/08/27 22:32:41 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.129 2011/08/29 21:43:09 chl Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -793,7 +793,8 @@ forkmda(struct imsgev *iev, u_int32_t id, error("mkdir tmp failed"); if (mkdir("new", 0700) < 0 && errno != EEXIST) error("mkdir new failed"); - snprintf(tmp, sizeof tmp, "tmp/%d.%d.%s", time(NULL), + snprintf(tmp, sizeof tmp, "tmp/%lld.%d.%s", + (long long int) time(NULL), getpid(), env->sc_hostname); fd = open(tmp, O_CREAT | O_EXCL | O_WRONLY, 0600); if (fd < 0) |