From 844a6f44c519e31a2ad96d1d753ddd3a76736fc5 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Mon, 10 Feb 2014 12:40:18 +0000 Subject: Can't close if we haven't a handle --- lib/gitano/repository.lua | 9 +++++++-- 1 file 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") -- cgit v1.2.1