1
1
mirror of https://git.shadowkat.net/izaya/OC-PsychOS2.git synced 2026-01-10 00:12:28 -05:00

Merge pull request 'services: Add missing returns' (#5) from Amanda/OC-PsychOS2:services/fix-start into master

Reviewed-on: https://git.shadowkat.net/izaya/OC-PsychOS2/pulls/5
This commit is contained in:
Izaya 2025-09-09 21:16:15 +10:00
commit 965ee98f85
5 changed files with 31 additions and 17 deletions

View File

@ -15,3 +15,4 @@ function start()
end end
end) end)
end end
return {start=start}

View File

@ -21,5 +21,6 @@ function start()
state = false state = false
end end
end end
end,"screenblank") end, "screenblank")
end end
return {start=start}

View File

@ -16,13 +16,19 @@ end
for addr in component.list("tape_drive") do for addr in component.list("tape_drive") do
addNode(addr) addNode(addr)
end end
while true do
local tE = {coroutine.yield()} function start()
if tE[1] == "component_added" and tE[3] == "tape_drive" then return os.spawn(function()
addNode(tE[2]) while true do
elseif tE[1] == "component_removed" and tE[3] == "tape_drive" then local tE = {coroutine.yield()}
if td[tE[2]] then if tE[1] == "component_added" and tE[3] == "tape_drive" then
fs.remove("/dev/tape"..tostring(td[tE[2]])) addNode(tE[2])
elseif tE[1] == "component_removed" and tE[3] == "tape_drive" then
if td[tE[2]] then
fs.remove("/dev/tape"..tostring(td[tE[2]]))
end
end
end end
end end, "tape-devfs")
end end
return {start=start}

View File

@ -61,3 +61,4 @@ function start()
end end
end,"termsrv") end,"termsrv")
end end
return {start=start}

View File

@ -6,13 +6,18 @@ for modem in component.list("modem") do
component.invoke(modem,"setWakeMessage",message) component.invoke(modem,"setWakeMessage",message)
end end
local ltime = computer.uptime() function start()
while true do return os.spawn(function()
if computer.uptime() > ltime+delay then local ltime = computer.uptime()
for modem in component.list("modem") do while true do
component.invoke(modem,"broadcast",port,message) if computer.uptime() > ltime+delay then
for modem in component.list("modem") do
component.invoke(modem,"broadcast",port,message)
end
ltime=computer.uptime()
end
coroutine.yield()
end end
ltime=computer.uptime() end, "WoLBeacon")
end
coroutine.yield()
end end
return {start=start}