[OpenWrt-Devel,2/2] base-files: uci-defaults: do config flush in one shot
diff mbox series

Message ID 20191021211020.15412-1-roman@advem.lv
State Accepted
Delegated to: John Crispin
Headers show
Series
  • [OpenWrt-Devel,1/2] libubox: update to latest git HEAD
Related show

Commit Message

Roman Yeryomin Oct. 21, 2019, 9:10 p.m. UTC
Moving a file between tmpfs and other fs is neither
faster nor safer, thus no point in doing it in two steps.
Use new jshn option to write output directly to file.

Originally discussed here:
http://lists.openwrt.org/pipermail/openwrt-devel/2017-December/010127.html

Signed-off-by: Roman Yeryomin <roman@advem.lv>
---
 package/base-files/files/lib/functions/uci-defaults.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index c2c6dc3fdc..0d2dcd5241 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -615,6 +615,5 @@  board_config_update() {
 }
 
 board_config_flush() {
-	json_dump -i > /tmp/.board.json
-	mv /tmp/.board.json ${CFG}
+	json_dump -i -o ${CFG}
 }