提交 a762311a 编写于 作者: A Alex Kiernan 提交者: Tom Rini

fw_env: Add missing write failure check

If flash_write fails, whilst we propagate this up to our caller, we need
to avoid swapping in the new file (if we're on a filesystem) in this
case.

Fixes: dbc34323 ("tools: env: Implement atomic replace for filesystem")
Signed-off-by: NAlex Kiernan <alex.kiernan@gmail.com>
上级 656d8da9
......@@ -1317,7 +1317,7 @@ static int flash_io_write(int fd_current)
rc = -1;
}
if (target_temp) {
if (rc >= 0 && target_temp) {
int dir_fd;
dir_fd = open(dname, O_DIRECTORY | O_RDONLY);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册