summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-02-10 12:40:18 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-03-06 15:08:49 +0000
commit3b5ef2dc366ae22a30d6a1095d69fc8a9f8313d5 (patch)
treefeceb1554bd06fcf121b1c0e9d36249de39dd1d1
parent0e8905a9fd69eb481cb74a45447d2e8f6277c420 (diff)
downloadgitano-3b5ef2dc366ae22a30d6a1095d69fc8a9f8313d5.tar.gz
Can't close if we haven't a handle
-rw-r--r--lib/gitano/repository.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua
index 5d4a194..a15fcbe 100644
--- a/lib/gitano/repository.lua
+++ b/lib/gitano/repository.lua
@@ -183,8 +183,13 @@ function repo_method:check_local_git_files()
end
if anonexport then
log.ddebug("<" .. self.name .. ">: Anonymous read allowed")
- local fh = sio.open(self:fs_path() .. "/git-daemon-export-ok", "wc")
- fh:close()
+ local fh, errmsg = sio.open(self:fs_path() .. "/git-daemon-export-ok", "wc")
+
+ if fh then
+ fh:close()
+ else
+ log.warn("Can't create git-daemon-export file:", errmsg)
+ end
else
log.ddebug("<" .. self.name .. ">: Anonymous read not allowed")
luxio.unlink(self:fs_path() .. "/git-daemon-export-ok")