[flashrom] [PATCH 3/7] layout: Add -i <image>[:<file>] support
David Hendricks
dhendrix at google.com
Sat Aug 20 01:00:45 CEST 2011
one minor nit
On Fri, Aug 19, 2011 at 8:00 AM, Stefan Tauner <
stefan.tauner at student.tuwien.ac.at> wrote:
> +static int read_content_from_file(romlayout_t *entry, uint8_t
> *newcontents)
> +{
> + char *file;
> + FILE *fp;
> + int len;
> +
> + file = entry->file;
> + len = entry->end - entry->start + 1;
> + if (file[0] != '\0') {
> + int numbytes;
> + if ((fp = fopen(file, "rb")) == NULL) {
> + perror(file);
>
Hmmmm, I'm not sure why we used perror()... Perhaps it would be better to
use msg_gerr(strerror(errno))?
> + return 1;
> + }
> + numbytes = fread(newcontents + entry->start, 1, len, fp);
> + fclose(fp);
> + if (numbytes != len) {
> + perror(file);
>
same as above.
--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20110819/11aa0773/attachment.html>
More information about the flashrom
mailing list