# HG changeset patch # User Kim Alvefur # Date 1488384956 -3600 # Node ID 9d014aca766f9597a5acf9f7292f841712a68b62 # Parent 7132abcf669e7d93cae6937f2dd9e471e1187722 util.datamanager: Use atomic store function when writing the first entry of a list diff -r 7132abcf669e -r 9d014aca766f util/datamanager.lua --- a/util/datamanager.lua Wed Mar 01 17:04:48 2017 +0100 +++ b/util/datamanager.lua Wed Mar 01 17:15:56 2017 +0100 @@ -228,11 +228,8 @@ 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");