diff options
Diffstat (limited to 'bin/ksh/mail.c')
-rw-r--r-- | bin/ksh/mail.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bin/ksh/mail.c b/bin/ksh/mail.c index f4b31e0c3bf..570722d57bc 100644 --- a/bin/ksh/mail.c +++ b/bin/ksh/mail.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.c,v 1.24 2018/06/25 15:22:30 cheloha Exp $ */ +/* $OpenBSD: mail.c,v 1.25 2019/01/07 20:50:43 tedu Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -47,6 +47,15 @@ mcheck(void) struct stat stbuf; static int first = 1; + if (mplist) + mbp = mplist; + else if ((vp = global("MAIL")) && (vp->flag & ISSET)) + mbp = &mbox; + else + mbp = NULL; + if (mbp == NULL) + return; + clock_gettime(CLOCK_MONOTONIC, &now); if (first) { mlastchkd = now; @@ -56,13 +65,6 @@ mcheck(void) if (elapsed.tv_sec >= mailcheck_interval) { mlastchkd = now; - if (mplist) - mbp = mplist; - else if ((vp = global("MAIL")) && (vp->flag & ISSET)) - mbp = &mbox; - else - mbp = NULL; - while (mbp) { if (mbp->mb_path && stat(mbp->mb_path, &stbuf) == 0 && S_ISREG(stbuf.st_mode)) { |