summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 746f2987..9e184522 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -366,8 +366,11 @@ signal_xcpu_handler(int sig)
int margin_for_handler = 5;
bool give_more_time = true;
+ if (last_time_exceeded == 0)
+ last_time_exceeded = login_start_time;
+ assert(last_time_exceeded);
// 不用 (time(0) - login_start_time) 來平均, 避免用好幾天之後突然狂吃 cpu 的狀況.
- if (last_time_exceeded != 0 && time(0) - last_time_exceeded < 86400)
+ if (time(0) - last_time_exceeded < 86400)
give_more_time = false;
last_time_exceeded = time(0);