mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
fix: 改进重启逻辑以支持os.reboot回退方案
当os.reboot可用时优先使用,否则回退到shutdown函数,确保重启功能更可靠
This commit is contained in:
@@ -56,7 +56,13 @@ function rc.shutdown()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function rc.reboot()
|
function rc.reboot()
|
||||||
reboot()
|
-- Try to use os.reboot if available
|
||||||
|
if os.reboot then
|
||||||
|
os.reboot()
|
||||||
|
else
|
||||||
|
-- Fallback to shutdown if reboot isn't available
|
||||||
|
shutdown()
|
||||||
|
end
|
||||||
while true do coroutine.yield() end
|
while true do coroutine.yield() end
|
||||||
end
|
end
|
||||||
local timer_filter = {}
|
local timer_filter = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user