diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-01 17:15:56 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-01 17:15:56 +0100 |
commit | c0c7406558c6b1af66341da2beeab9c2f0317737 (patch) | |
tree | 4d18ec72cf7237e5e46f9bd20cbbe2474c932597 | |
parent | ed6045747c843b8c94ceb899a0dff5477d59e891 (diff) | |
download | prosody-c0c7406558c6b1af66341da2beeab9c2f0317737.tar.gz prosody-c0c7406558c6b1af66341da2beeab9c2f0317737.zip |
util.datamanager: Use atomic store function when writing the first entry of a list
-rw-r--r-- | util/datamanager.lua | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/util/datamanager.lua b/util/datamanager.lua index 8ef3c050..d36865d7 100644 --- a/util/datamanager.lua +++ b/util/datamanager.lua @@ -228,11 +228,8 @@ local function append(username, host, datastore, ext, data) local ok; local f, msg = io_open(filename, "r+"); if not f then + return atomic_store(filename, data); -- File did probably not exist, let's create it - f, msg = io_open(filename, "w"); - if not f then - return nil, msg, "open"; - end end local pos = f:seek("end"); |