projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
modules/luci-mod-failsafe: Fix nil file descriptor error
[project/luci.git]
/
modules
/
luci-mod-failsafe
/
luasrc
/
controller
/
failsafe
/
failsafe.lua
diff --git
a/modules/luci-mod-failsafe/luasrc/controller/failsafe/failsafe.lua
b/modules/luci-mod-failsafe/luasrc/controller/failsafe/failsafe.lua
index
6f78643
..
60caadb
100644
(file)
--- a/
modules/luci-mod-failsafe/luasrc/controller/failsafe/failsafe.lua
+++ b/
modules/luci-mod-failsafe/luasrc/controller/failsafe/failsafe.lua
@@
-84,11
+84,13
@@
function action_flashops()
fp = io.open(image_tmp, "w")
end
end
- if chunk then
- fp:write(chunk)
- end
- if eof then
- fp:close()
+ if fp then
+ if chunk then
+ fp:write(chunk)
+ end
+ if eof then
+ fp:close()
+ end
end
end
)