Attention is currently required from: Daniel Campello. Jack Rosenthal has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52383 )
Change subject: flashrom.c: allow - as filename for stdin/stdout ......................................................................
Patch Set 6:
(7 comments)
Patchset:
PS6: one issue I see is that logging will be sent to stdout for non-errors.
see flashrom_print_cb in cli_output.c
can we check for the condition that verbose logging is enabled with sending data to stdout and error? otherwise the user will end up with jarbled-up flash contents on stdout and not know exactly why...
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/52383/comment/e292f195_253c4023 PS6, Line 152: (argv[optind][0] != '-' || argv[optind][1] == '\0') !strcmp(argv[optind], "-") would be slightly easier to read, IMO
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/52383/comment/2912263e_19edd55f PS6, Line 1351: strncmp(filename, "-", sizeof("-"))) strncmp here is analagous to "starts with"
so this reads: "filename starts with '-'"
if you wanted filename == '-', then use !strcmp(filename, "-")
https://review.coreboot.org/c/flashrom/+/52383/comment/2a4fc0b4_ae5b34f4 PS6, Line 1352: fdopen(STDIN_FILENO, "rb") stdin
https://review.coreboot.org/c/flashrom/+/52383/comment/66a7dd67_707bab25 PS6, Line 1367: (strncmp(filename, "-", sizeof("-")))) same comment as above
https://review.coreboot.org/c/flashrom/+/52383/comment/ac94a678_7b606106 PS6, Line 1444: trncmp(filename, "-", sizeof("-"))) ditto, I don't think we want all files that start with - to act this way
https://review.coreboot.org/c/flashrom/+/52383/comment/b9c2adad_ba679b9c PS6, Line 1445: fdopen(STDOUT_FILENO, "wb") stdout