void ckmailstatus() { if (u.uswallow || !flags.biff) return; if (mustgetmail < 0) { #if defined(AMIGA) || defined(MSDOS) || defined(TOS) mustgetmail=(moves<2000)?(100+rn2(2000)):(2000+rn2(3000)); #endif return; } if (--mustgetmail <= 0) { static struct mail_info deliver = {MSG_MAIL,"I have some mail for you",0,0}; newmail(&deliver); mustgetmail = -1; } }
void ckmailstatus(void) { if (!mailbox #ifdef MAILCKFREQ || moves < laststattime + MAILCKFREQ #endif // MAILCKFREQ ) return; laststattime = moves; if (stat(mailbox, &nmstat)) { #ifdef PERMANENT_MAILBOX pline("Cannot get status of MAIL=%s anymore.", mailbox); mailbox = 0; #else nmstat.st_mtime = 0; #endif // PERMANENT_MAILBOX } else if (nmstat.st_mtime > omstat.st_mtime) { if (nmstat.st_size) newmail(); getmailstatus(); // might be too late ... } }