aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-11 20:18:24 +0100
committerKim Alvefur <zash@zash.se>2015-12-11 20:18:24 +0100
commitc54585b91c729ef71c2fd272dcf2675311f5a96a (patch)
treec9c3f63a4f5e44b197e3332c2489c96f6b48d9f5 /util
parent51302e343c590e887b3b53de95b4afed0df453bb (diff)
downloadprosody-c54585b91c729ef71c2fd272dcf2675311f5a96a.tar.gz
prosody-c54585b91c729ef71c2fd272dcf2675311f5a96a.zip
util.datamanager: Skip past second check if first attemtp to open file succeeds
Diffstat (limited to 'util')
-rw-r--r--util/datamanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 4a371d2c..b7c514ad 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -214,9 +214,9 @@ local function append(username, host, datastore, ext, data)
local f, msg = io_open(filename, "r+");
if not f then
f, msg = io_open(filename, "w");
- end
- if not f then
- return nil, msg;
+ if not f then
+ return nil, msg;
+ end
end
local pos = f:seek("end");
local ok, msg = fallocate(f, pos, #data);