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 | c3aae40b197b00014765a5dcc2874e4483a5d6dc (patch) | |
tree | 4d18ec72cf7237e5e46f9bd20cbbe2474c932597 /util/datamanager.lua | |
parent | f0c676e8c6e714fcdd898c913af0b705ccde61ee (diff) | |
download | prosody-c3aae40b197b00014765a5dcc2874e4483a5d6dc.tar.gz prosody-c3aae40b197b00014765a5dcc2874e4483a5d6dc.zip |
util.datamanager: Use atomic store function when writing the first entry of a list
Diffstat (limited to 'util/datamanager.lua')
-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"); |