From f7a60d5addaa7def280574cc78b52b44a3644921 Mon Sep 17 00:00:00 2001 From: Erwan MAS Date: Mon, 26 May 2025 16:40:13 -0400 Subject: [PATCH] - rewrite some tests involving time_t so he will perform better on 32 bits platform --- src/mlmmj-maintd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mlmmj-maintd.c b/src/mlmmj-maintd.c index cb378bcf..96d14693 100644 --- a/src/mlmmj-maintd.c +++ b/src/mlmmj-maintd.c @@ -203,7 +203,7 @@ resend_queue(struct ml *ml, int logfd) mail currently being sent */ t = time(NULL); if(fstatat(qfd, dp->d_name, &st, 0) == 0) { - if(t - st.st_mtime > (time_t)36000) { + if(t - (time_t)36000 > st.st_mtime) { unlinkat(qfd, dp->d_name, 0); /* avoid leaving orphans */ unlinkat(qfd, fromname, 0); @@ -221,7 +221,7 @@ resend_queue(struct ml *ml, int logfd) /* before we try again, check and see if it's old */ bouncelife = ctrltimet(ml->ctrlfd, "bouncelife", BOUNCELIFE); t = time(NULL); - if(t - st.st_mtime > bouncelife) { + if(t - bouncelife > st.st_mtime ) { if (unlinkat(qfd, dp->d_name, 0) == -1) { log(" - Could not remove queue/%s: %s\n", dp->d_name, strerror(errno)); @@ -291,7 +291,7 @@ resend_requeue(struct ml *ml, const char *mlmmjsend, int logfd) /* Remove old empty directories */ t = time(NULL); - if(t - st.st_mtime > (time_t)3600 && + if(t - (time_t)3600 > st.st_mtime && unlinkat(fd, dp->d_name, AT_REMOVEDIR) == 0) continue; -- 2.47.2