[fsync] Check whether API_PATH actually exists and contains any symlinks. Thanks Mario!

This commit is contained in:
Bart Van Der Meerssche 2011-05-11 16:04:28 +02:00
parent 068040a4b4
commit 69d7922dab
1 changed files with 4 additions and 2 deletions

View File

@ -318,10 +318,12 @@ end
--- Remove all /sensor/xyz endpoint mappings to the cgi script.
-- @return none
local function remove_symlinks()
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
--- Map /sensor/xyz endpoints to the cgi script.
-- @return none