amdfwtool: Call wrapper funtion to write file

Don't call system call directly.

Change-Id: I6da31723bc2bfc1197fc31962053671c84ccc397
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73911
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
This commit is contained in:
Zheng Bao 2023-03-22 12:51:47 +08:00 committed by Felix Held
parent f080cd5463
commit c25d5935d3
1 changed files with 1 additions and 1 deletions

View File

@ -2392,7 +2392,7 @@ int main(int argc, char **argv)
ctx.current - offset : sizeof(*amd_romsig); ctx.current - offset : sizeof(*amd_romsig);
uint32_t ret_bytes; uint32_t ret_bytes;
ret_bytes = write(targetfd, BUFF_OFFSET(ctx, offset), bytes); ret_bytes = write_from_buf_to_file(targetfd, BUFF_OFFSET(ctx, offset), bytes);
if (bytes != ret_bytes) { if (bytes != ret_bytes) {
fprintf(stderr, "Error: Writing to file %s failed\n", output); fprintf(stderr, "Error: Writing to file %s failed\n", output);
retval = 1; retval = 1;