diff options
author | Kim Alvefur <zash@zash.se> | 2015-12-11 20:26:04 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-12-11 20:26:04 +0100 |
commit | 1099fb8dd73854dcf77e618378034869ca096638 (patch) | |
tree | 329f3ec36bd71b4d0fcd1630b446d0644fcd3d51 | |
parent | 93304d3439bdf8479bf24971487275432045dd41 (diff) | |
download | prosody-1099fb8dd73854dcf77e618378034869ca096638.tar.gz prosody-1099fb8dd73854dcf77e618378034869ca096638.zip |
util.datamanager: Handle potential error from :write() call
-rw-r--r-- | util/datamanager.lua | 6 |
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 |