From 69d7922dabef34d21741edb822ad8ae5dc1f3414 Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Wed, 11 May 2011 16:04:28 +0200 Subject: [PATCH] [fsync] Check whether API_PATH actually exists and contains any symlinks. Thanks Mario! --- mote/v2/openwrt/package/flukso/luasrc/fsync.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mote/v2/openwrt/package/flukso/luasrc/fsync.lua b/mote/v2/openwrt/package/flukso/luasrc/fsync.lua index 79410fa..377406b 100755 --- a/mote/v2/openwrt/package/flukso/luasrc/fsync.lua +++ b/mote/v2/openwrt/package/flukso/luasrc/fsync.lua @@ -318,8 +318,10 @@ end --- Remove all /sensor/xyz endpoint mappings to the cgi script. -- @return none local function remove_symlinks() - for symlink in nixio.fs.dir(API_PATH) do - nixio.fs.unlink(API_PATH .. symlink) + if nixio.fs.dir(API_PATH) then + for symlink in nixio.fs.dir(API_PATH) do + nixio.fs.unlink(API_PATH .. symlink) + end end end