diff options
| author | Diego MartÃnez <kaeza@users.noreply.github.com> | 2015-11-01 14:04:33 -0300 | 
|---|---|---|
| committer | Diego MartÃnez <kaeza@users.noreply.github.com> | 2015-11-01 14:04:33 -0300 | 
| commit | 2903f6ae5a64e0e9a4c6fb660a2cf1d16a5cc689 (patch) | |
| tree | 6b42fff343911ae81c40f7b03bbdb21ca182a459 | |
| parent | 5d91fb66adb58c38c539c81abffd5df689402067 (diff) | |
Fix spurious warnings on database save.
| -rw-r--r-- | init.lua | 8 | 
1 files changed, 6 insertions, 2 deletions
| @@ -283,8 +283,12 @@ local function save_db()  	local f, e = io.open(DB_FILENAME, "wt")  	db.timestamp = os.time()  	if f then -		local ok = f:write(xban.serialize(db)) -		WARNING("Unable to save database: %s", "Write failed") +		local ok, err = f:write(xban.serialize(db)) +		if not ok then +			WARNING("Unable to save database: %s", err) +		end +	else +		WARNING("Unable to save database: %s", e)  	end  	if f then f:close() end  	return | 
