From ad269bf97420ae1872fd2b4ae44e57e6b9cb7fda Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 11 Jan 2024 00:29:32 +0700 Subject: [PATCH] Update init_bb.php --- library/includes/init_bb.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index fc2052d1..2719f859 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -546,30 +546,21 @@ function cron_release_deadlock () function cron_release_file_lock () { - if (file_exists(CRON_RUNNING)) - { - rename(CRON_RUNNING, CRON_ALLOWED); - } + $lock_released = @rename(CRON_RUNNING, CRON_ALLOWED); cron_touch_lock_file(CRON_ALLOWED); } function cron_touch_lock_file ($lock_file) { - file_write('', $lock_file, 0, true, true); + file_write(make_rand_str(20), $lock_file, 0, true, true); } function cron_enable_board () { - if (file_exists(BB_DISABLED)) - { - rename(BB_DISABLED, BB_ENABLED); - } + @rename(BB_DISABLED, BB_ENABLED); } function cron_disable_board () { - if (file_exists(BB_ENABLED)) - { - rename(BB_ENABLED, BB_DISABLED); - } + @rename(BB_ENABLED, BB_DISABLED); }