Tested on physical hardware, built on FreeBSD (less portability 'headaches').
Signed-off-By: Idwer Vollering vidwer@gmail.com
Index: cli_output.c =================================================================== --- cli_output.c (revision 1846) +++ cli_output.c (working copy) @@ -52,8 +52,12 @@ msg_gerr("No logfile name specified.\n"); return 1; } - if ((logfile = fopen(filename, "w")) == NULL) { + if ((logfile = fopen(filename, "xw")) == NULL) { msg_gerr("Error: opening log file "%s" failed: %s\n", filename, strerror(errno)); + msg_gdbg("This means that flashrom can't write log output\n" \ + "to the file you specified ("%s"),\n" \ + "or you are using the same filename to read from/write to (-r / -w)\n" \ + "and write the log output to (-o).\n", filename); return 1; } return 0;