summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/cache.c14
-rw-r--r--mbbsd/record.c8
-rw-r--r--mbbsd/var.c12
3 files changed, 22 insertions, 12 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 7b26f8f2..945fed88 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -492,7 +492,7 @@ setutmpmode(unsigned int mode)
if (HAS_PERM(PERM_LOGUSER)) {
char msg[200];
snprintf(msg, sizeof(msg), "%s setutmpmode to %s(%d) at %s",
- cuser.userid, modestring(currutmp, 0), mode, Cdate(&now));
+ cuser.userid, modestring(currutmp, 0), mode, Cdate(&COMMON_TIME));
log_user(msg);
}
}
@@ -518,8 +518,8 @@ load_fileheader_cache(int bid, char *direct)
{
int num = getbtotal(bid);
int n = num - DIRCACHESIZE + 1;
- if (SHM->Bbusystate != 1 && now - SHM->busystate_b[bid - 1] >= 10) {
- SHM->busystate_b[bid - 1] = now;
+ if (SHM->Bbusystate != 1 && COMMON_TIME - SHM->busystate_b[bid - 1] >= 10) {
+ SHM->busystate_b[bid - 1] = COMMON_TIME;
get_records(direct, SHM->dircache[bid - 1],
sizeof(fileheader_t), n < 1 ? 1 : n, DIRCACHESIZE);
SHM->busystate_b[bid - 1] = 0;
@@ -620,7 +620,7 @@ void resolve_boards(void)
void touch_boards(void)
{
- SHM->Btouchtime = now;
+ SHM->Btouchtime = COMMON_TIME;
numboards = -1;
resolve_boards();
}
@@ -639,10 +639,10 @@ reset_board(int bid) /* XXXbid: from 1 */
if (--bid < 0)
return;
- if (SHM->Bbusystate || now - SHM->busystate_b[bid] < 10) {
+ if (SHM->Bbusystate || COMMON_TIME - SHM->busystate_b[bid] < 10) {
safe_sleep(1);
} else {
- SHM->busystate_b[bid] = now;
+ SHM->busystate_b[bid] = COMMON_TIME;
nuser = bcache[bid].nuser;
bhdr = bcache;
@@ -998,7 +998,7 @@ hbflreload(int bid)
}
fclose(fp);
}
- hbfl[0] = now;
+ hbfl[0] = COMMON_TIME;
memcpy(SHM->hbfl[bid], hbfl, sizeof(hbfl));
}
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 2bd06b16..e16b9404 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -1,4 +1,4 @@
-/* $Id: record.c,v 1.14 2003/06/28 08:47:45 kcwu Exp $ */
+/* $Id$ */
#include "bbs.h"
#undef HAVE_MMAP
@@ -467,7 +467,7 @@ int
stampfile(char *fpath, fileheader_t * fh)
{
register char *ip = fpath;
- time_t dtime = now;
+ time_t dtime = COMMON_TIME;
struct tm *ptime;
int fp = 0;
@@ -494,7 +494,7 @@ void
stampdir(char *fpath, fileheader_t * fh)
{
register char *ip = fpath;
- time_t dtime = now;
+ time_t dtime = COMMON_TIME;
struct tm *ptime;
if (access(fpath, X_OK | R_OK | W_OK))
@@ -516,7 +516,7 @@ void
stamplink(char *fpath, fileheader_t * fh)
{
register char *ip = fpath;
- time_t dtime = now;
+ time_t dtime = COMMON_TIME;
struct tm *ptime;
if (access(fpath, X_OK | R_OK | W_OK))
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 4ba3cf9e..7df518e5 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -1,4 +1,4 @@
-/* $Id: var.c,v 1.21 2003/07/20 00:55:34 in2 Exp $ */
+/* $Id$ */
#define INCLUDE_VAR_H
#include "bbs.h"
@@ -621,3 +621,13 @@ char *friend_file[8] = {
FN_WATER,
FN_VISABLE
};
+
+#ifdef PTTBBS_UTIL
+ #ifdef OUTTA_TIMER
+ #define COMMON_TIME (SHM->GV2.e.now)
+ #else
+ #define COMMON_TIME (time(0))
+ #endif
+#else
+ #define COMMON_TIME (now)
+#endif