Attention is currently required from: Zheng Bao.

Bao Zheng would like Zheng Bao to review this change.

View Change

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);

To view, visit change 73911. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6da31723bc2bfc1197fc31962053671c84ccc397
Gerrit-Change-Number: 73911
Gerrit-PatchSet: 1
Gerrit-Owner: Bao Zheng <fishbaozi@gmail.com>
Gerrit-Reviewer: Zheng Bao
Gerrit-Attention: Zheng Bao
Gerrit-MessageType: newchange