From: Erwan MAS Date: Mon, 26 May 2025 20:40:13 +0000 (-0400) Subject: - rewrite some tests involving time_t so he will perform better on 32 bits platform X-Git-Tag: RELEASE_1.5.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F53%2Fhead;p=thirdparty%2Fmlmmj.git - rewrite some tests involving time_t so he will perform better on 32 bits platform --- 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;