MCPcopy Create free account
hub / github.com/coreboot/coreboot / buffer_write_file

Function buffer_write_file

util/cbfstool/common.c:96–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96int buffer_write_file(struct buffer *buffer, const char *filename)
97{
98 FILE *fp = fopen(filename, "wb");
99 if (!fp) {
100 perror(filename);
101 return -1;
102 }
103 assert(buffer && buffer->data);
104 if (fwrite(buffer->data, 1, buffer->size, fp) != buffer->size) {
105 fprintf(stderr, "incomplete write: %s\n", filename);
106 fclose(fp);
107 return -1;
108 }
109 fclose(fp);
110 return 0;
111}
112
113void buffer_delete(struct buffer *buffer)
114{

Callers 14

write_partition_to_fileFunction · 0.85
elog_writeFunction · 0.85
cbfs_readFunction · 0.85
cbfs_export_entryFunction · 0.85
mainFunction · 0.85
ifwi_repackFunction · 0.85
write_partition_to_fileFunction · 0.85
cmd_create_layoutFunction · 0.85
cmd_create_cse_regionFunction · 0.85
cmd_create_bpdtFunction · 0.85
flashrom_host_writeFunction · 0.85
ifwi_writeFunction · 0.85

Calls 5

fopenFunction · 0.85
perrorFunction · 0.85
fwriteFunction · 0.85
fprintfFunction · 0.85
fcloseFunction · 0.85

Tested by

no test coverage detected