util/watchdog.lua
changeset 6780 5de6b93d0190
parent 4891 189cfe565d03
child 8558 4f0f5b49bb03
--- a/util/watchdog.lua	Mon Aug 10 22:16:05 2015 +0200
+++ b/util/watchdog.lua	Sat Feb 21 10:36:37 2015 +0100
@@ -2,12 +2,12 @@
 local setmetatable = setmetatable;
 local os_time = os.time;
 
-module "watchdog"
+local _ENV = nil;
 
 local watchdog_methods = {};
 local watchdog_mt = { __index = watchdog_methods };
 
-function new(timeout, callback)
+local function new(timeout, callback)
 	local watchdog = setmetatable({ timeout = timeout, last_reset = os_time(), callback = callback }, watchdog_mt);
 	timer.add_task(timeout+1, function (current_time)
 		local last_reset = watchdog.last_reset;
@@ -31,4 +31,6 @@
 	self.last_reset = nil;
 end
 
-return _M;
+return {
+	new = new;
+};