Software /
code /
prosody
Comparison
util/datamanager.lua @ 7200:67ac4a0b6e50
util.datamanager: Unreference file handle after closing it to prevent trying to close it again (fixes #632)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 25 Feb 2016 22:36:42 +0100 |
parent | 6681:0217a04722c7 |
child | 7201:7a8cffafeff0 |
comparison
equal
deleted
inserted
replaced
7105:01bd0ac9cf0c | 7200:67ac4a0b6e50 |
---|---|
150 | 150 |
151 ok, msg = f:write(data); | 151 ok, msg = f:write(data); |
152 if not ok then break end | 152 if not ok then break end |
153 | 153 |
154 ok, msg = f:close(); | 154 ok, msg = f:close(); |
155 f = nil; -- no longer valid | |
155 if not ok then break end | 156 if not ok then break end |
156 | 157 |
157 return os_rename(scratch, filename); | 158 return os_rename(scratch, filename); |
158 until false; | 159 until false; |
159 | 160 |