Changeset

7462:ced4e800f42a

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Tue, 28 Jun 2016 14:54:43 +0100
parents 7456:76a8456cf1e2 (current diff) 7461:72e48bddf617 (diff)
children 7465:f1923f00b7de
files
diffstat 3 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/openssl.lua	Sun Jun 12 20:06:30 2016 +0200
+++ b/util/openssl.lua	Tue Jun 28 14:54:43 2016 +0100
@@ -166,7 +166,8 @@
 	setmetatable(_M, {
 		__index = function(_, command)
 			return function(opts)
-				return 0 == os_execute(serialize(command, type(opts) == "table" and opts or {}));
+				local ret = os_execute(serialize(command, type(opts) == "table" and opts or {}));
+				return ret == true or ret == 0;
 			end;
 		end;
 	});
--- a/util/prosodyctl.lua	Sun Jun 12 20:06:30 2016 +0200
+++ b/util/prosodyctl.lua	Tue Jun 28 14:54:43 2016 +0100
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/time.lua	Tue Jun 28 14:54:43 2016 +0100
@@ -0,0 +1,8 @@
+-- Import gettime() from LuaSocket, as a way to access high-resolution time
+-- in a platform-independent way
+
+local socket_gettime = require "socket".gettime;
+
+return {
+	now = socket_gettime;
+}