From 903649d3aa8aaea5af4fbf833cb1f1b7418d2aa8 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Wed, 1 Dec 2010 13:39:11 +0000 Subject: [PATCH] fixing alarms --- examples/lsayirc.lua | 11 +++++++---- lsyncd.lua | 3 +-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/lsayirc.lua b/examples/lsayirc.lua index afbe8a8..12ebbcf 100644 --- a/examples/lsayirc.lua +++ b/examples/lsayirc.lua @@ -23,7 +23,7 @@ ircSocket:settimeout(0) -- Buffer for stuff to send and receive on IRC: local ircWBuf = "" local ircRBuf = "" -local writeIrc +local writeIrc ----- -- Called when the IRC socket can be written @@ -35,7 +35,6 @@ end -- Called when socket can be read local function ircReady(socket) local l, err, ircRBuf = ircSocket:receive("*l", ircRBuf) - log("Normal", "XXX", l) if not l then if errr ~= "timeout" then log("Error", "IRC connection failed: ", err) @@ -98,10 +97,10 @@ local function action(inlet) local event, event2 = inlet.getEvent() if not event2 then writeIrc("PRIVMSG ",chan," :",event.etype," ", - event.path) + event.path, "\n") else writeIrc("PRIVMSG ",chan," :",event.etype," ", - event.path," -> ",event2.path) + event.path," -> ",event2.path, "\n") end inlet.discardEvent(event) end @@ -110,3 +109,7 @@ end sync{source= "src", action= action, delay= 1 } + +for k, v in pairs(_G) do + print(k, v) +end diff --git a/lsyncd.lua b/lsyncd.lua index 0633ab3..3fe36a7 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1241,7 +1241,7 @@ local Sync = (function() -- finds the nearest delay waiting to be spawned for _, d in ipairs(self.delays) do if d.status == "wait" then - return alarm + return d.alarm end end end @@ -2616,7 +2616,6 @@ end -- function runner.getAlarm() local alarm = false - ---- -- checks if current nearest alarm or a is earlier --