From 2d581a2b62a398963e4e418243b10e02b8d648af Mon Sep 17 00:00:00 2001 From: equa Date: Sun, 13 Mar 2022 18:01:02 +0000 Subject: Various fixes - add directory configuration option - add debug mode for checking output - fix FIFOs not actually being FIFOs - add user and pass configuration options - validate config files - don't fail instantly if we fail to exec or chdir; instead, wait for input to avoid restart loops - have ed restart on JOIN rather than instantly - output stderr to the channel as well --- fifo.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'fifo.lua') diff --git a/fifo.lua b/fifo.lua index 03a7af7..f3a3d10 100644 --- a/fifo.lua +++ b/fifo.lua @@ -11,7 +11,7 @@ function fifo.signal(f) end function fifo.get(f) - if not f.head then + while not f.head do f.cond:wait() end @@ -21,7 +21,13 @@ function fifo.get(f) end function fifo.put(f, data) - f.head = { data = data, tail = f.head } + local tail = f.head + while tail and tail.tail do tail = tail.tail end + if tail then + tail.tail = { data = data } + else + f.head = { data = data } + end fifo.signal(f) end -- cgit 1.3.0-6-gf8a5