util.prosodyctl: Handle os.execute in Lua 5.2 returning true when command terminates successfully
authorKim Alvefur <zash@zash.se>
Thu, 23 Jun 2016 21:07:48 +0200
changeset 7460 5e18416881bb
parent 7458 82d8c11ab0cb
child 7461 82710f8c1fe6
util.prosodyctl: Handle os.execute in Lua 5.2 returning true when command terminates successfully
util/prosodyctl.lua
--- a/util/prosodyctl.lua	Sun Jun 12 19:55:46 2016 +0200
+++ b/util/prosodyctl.lua	Thu Jun 23 21:07:48 2016 +0200
@@ -44,7 +44,7 @@
 local function getchar(n)
 	local stty_ret = os.execute("stty raw -echo 2>/dev/null");
 	local ok, char;
-	if stty_ret == 0 then
+	if stty_ret == true or stty_ret == 0 then
 		ok, char = pcall(io.read, n or 1);
 		os.execute("stty sane");
 	else