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 | 4b380b1cbfd38a79277c7359b015fbe134c23176 (patch) | |
tree | 329f3ec36bd71b4d0fcd1630b446d0644fcd3d51 | |
parent | be1b771edf344615e31f310259b2793c95c1d217 (diff) | |
download | prosody-4b380b1cbfd38a79277c7359b015fbe134c23176.tar.gz prosody-4b380b1cbfd38a79277c7359b015fbe134c23176.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 |