From 919865eb5b4f264215266aa6de82f7b0eb44ed6d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 2 Jan 2017 15:17:36 +0100 Subject: [PATCH] WIP: Crashes?!? Signed-off-by: Uli Schlachter --- lib/awful/spawn.lua | 5 +++++ tests/_client.lua | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lib/awful/spawn.lua b/lib/awful/spawn.lua index f5d51fb1d..b81b3091b 100644 --- a/lib/awful/spawn.lua +++ b/lib/awful/spawn.lua @@ -396,6 +396,11 @@ local function read_stream(stream, line_callback, done_callback, close) end end +local r = read_stream +local function read_stream(...) + protected_call(r, ...) +end + --- Read lines from a Gio input stream -- @tparam Gio.InputStream input_stream The input stream to read from. -- @tparam function line_callback Function that is called with each line diff --git a/tests/_client.lua b/tests/_client.lua index e3db5c7cd..583bd720e 100644 --- a/tests/_client.lua +++ b/tests/_client.lua @@ -41,6 +41,10 @@ local function read_input(stream) open_window(class, title, snid) end end +local r = read_input +local function read_input(stream) + print(pcall(function() r(stream) end)) +end -- Read lines from stdin and handle them local stdin = Gio.UnixInputStream.new(0, false)