Skip to content

Commit

Permalink
blocks/sinks/gnuplotwaterfall: fix gnuplot check with lua52compat luajit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vsergeev committed Dec 17, 2019
1 parent 5f49bad commit 7753a23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion radio/blocks/sinks/gnuplotwaterfall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7753a23

Please sign in to comment.