Attention is currently required from: Zheng Bao.
Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/73911
to review the following change.
Change subject: amdfwtool: Call wrapper funtion to write file ......................................................................
amdfwtool: Call wrapper funtion to write file
Change-Id: I6da31723bc2bfc1197fc31962053671c84ccc397 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 12 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/73911/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 8190b8d..05b4674 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -2390,13 +2390,9 @@ uint32_t offset = efs_location; uint32_t bytes = efs_location == body_location ? ctx.current - offset : sizeof(*amd_romsig); - uint32_t ret_bytes;
- ret_bytes = write(targetfd, BUFF_OFFSET(ctx, offset), bytes); - if (bytes != ret_bytes) { - fprintf(stderr, "Error: Writing to file %s failed\n", output); - retval = 1; - } + write_from_buf_to_file(targetfd, BUFF_OFFSET(ctx, offset), bytes); + close(targetfd); } else { fprintf(stderr, "Error: could not open file: %s\n", output);