From bbacdc6dbd99244179ceae8973ab4253a6420209 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 9 Jan 2019 15:56:19 +1100 Subject: [PATCH] moved the creation of a sink fd into createterms --- module/createterms.lua | 9 +++++++++ module/io.lua | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/module/createterms.lua b/module/createterms.lua index 23a8e35..ad73fab 100644 --- a/module/createterms.lua +++ b/module/createterms.lua @@ -6,3 +6,12 @@ for a,_ in component.list("gpu") do local r,w = vtemu(a,table.remove(ts,1)) fd[#fd+1] = {["read"]=r,["write"]=w,["close"]=function() w("\27[2J\27[H") end,["t"]="t"} end +if #fd < 1 then + local fdi,nfd = io.newfd() + function nfd.read() + end + function nfd.write() + end + function nfd.close() + end +end diff --git a/module/io.lua b/module/io.lua index 78d7a61..ceafd86 100644 --- a/module/io.lua +++ b/module/io.lua @@ -63,12 +63,3 @@ function io.open(f,m) -- opens file *f* with mode *m* return t end end -do - local fdi,nfd = io.newfd() - function nfd.read() - end - function nfd.write() - end - function nfd.close() - end -end