From: Richard Russon Date: Tue, 4 Sep 2018 18:00:25 +0000 (+0100) Subject: reduce scope X-Git-Tag: 2019-10-25~661^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa70a932005c18eef1bd3ae490e49bca8fa30a46;p=neomutt reduce scope --- diff --git a/mx.c b/mx.c index f60819e5c..5cad114c2 100644 --- a/mx.c +++ b/mx.c @@ -343,12 +343,6 @@ struct Context *mx_mbox_open(const char *path, int flags) */ void mx_fastclose_mailbox(struct Context *ctx) { -#ifdef HAVE_UTIMENSAT - struct timespec ts[2]; -#else - struct utimbuf ut; -#endif /* HAVE_UTIMENSAT */ - if (!ctx) return; @@ -356,14 +350,16 @@ void mx_fastclose_mailbox(struct Context *ctx) if (ctx->peekonly && ctx->mailbox->path && (mutt_timespec_compare(&ctx->mtime, &ctx->atime) > 0)) { #ifdef HAVE_UTIMENSAT + struct timespec ts[2]; ts[0] = ctx->atime; ts[1] = ctx->mtime; utimensat(0, ctx->mailbox->path, ts, 0); #else + struct utimbuf ut; ut.actime = ctx->atime.tv_sec; ut.modtime = ctx->mtime.tv_sec; utime(ctx->mailbox->path, &ut); -#endif /* HAVE_UTIMENSAT */ +#endif } /* never announce that a mailbox we've just left has new mail. #3290