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

Function write_file

util/intelvbttool/intelvbttool.c:454–467  ·  view source on GitHub ↗

Write fileobject contents to file */

Source from the content-addressed store, hash-verified

452
453/* Write fileobject contents to file */
454static int write_file(const char *filename, const struct fileobject *fo)
455{
456 FILE *fd_out = fopen(filename, "wb");
457
458 if (!fd_out) {
459 printerr("%s open failed: %s\n", filename, strerror(errno));
460 return 1;
461 }
462 if (fwrite(fo->data, 1, fo->size, fd_out) != fo->size) {
463 fclose(fd_out);
464 return 1;
465 }
466 return fclose(fd_out);
467}
468
469/* dump VBT contents in human readable form */
470static void dump_vbt(const struct fileobject *fo)

Callers 1

mainFunction · 0.85

Calls 5

fopenFunction · 0.85
printerrFunction · 0.85
strerrorFunction · 0.85
fwriteFunction · 0.85
fcloseFunction · 0.85

Tested by

no test coverage detected