diff options
author | Kim Alvefur <zash@zash.se> | 2015-12-11 20:18:24 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-12-11 20:18:24 +0100 |
commit | c54585b91c729ef71c2fd272dcf2675311f5a96a (patch) | |
tree | c9c3f63a4f5e44b197e3332c2489c96f6b48d9f5 | |
parent | 51302e343c590e887b3b53de95b4afed0df453bb (diff) | |
download | prosody-c54585b91c729ef71c2fd272dcf2675311f5a96a.tar.gz prosody-c54585b91c729ef71c2fd272dcf2675311f5a96a.zip |
util.datamanager: Skip past second check if first attemtp to open file succeeds
-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 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); |