From 7753a23bf0f3218b283ec2825ec2c1eb1b387241 Mon Sep 17 00:00:00 2001 From: "Vanya A. Sergeev" Date: Tue, 17 Dec 2019 00:45:26 -0600 Subject: [PATCH] blocks/sinks/gnuplotwaterfall: fix gnuplot check with lua52compat luajit when LuaJIT is built with Lua 5.2 compatibility (`-DLUAJIT_ENABLE_LUA52COMPAT`), `os.execute()` returns more detailed exit status, including a success boolean as the first return value instead of the integer exit code. resolves #43. --- radio/blocks/sinks/gnuplotwaterfall.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radio/blocks/sinks/gnuplotwaterfall.lua b/radio/blocks/sinks/gnuplotwaterfall.lua index 64b43e79d..6e6159035 100644 --- a/radio/blocks/sinks/gnuplotwaterfall.lua +++ b/radio/blocks/sinks/gnuplotwaterfall.lua @@ -65,7 +65,8 @@ end function GnuplotWaterfallSink:initialize() -- Check gnuplot exists - assert(os.execute("gnuplot --version >/dev/null 2>&1") == 0, "gnuplot not found. Is gnuplot installed?") + local ret = os.execute("gnuplot --version >/dev/null 2>&1") + assert(ret == 0 or ret == true, "gnuplot not found. Is gnuplot installed?") end function GnuplotWaterfallSink:write_gnuplot(s)