aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/datamanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 3016feed..ce4c5b5a 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -232,9 +232,9 @@ local function append(username, host, datastore, ext, data)
f:seek("set", pos);
end
- if ok then
- f:write(data);
- else
+ ok, msg = f:write(data);
+ if not ok then
+ f:close();
return ok, msg;
end