[coreboot] [PATCH]Move option table to CBFS

Peter Stuge peter at stuge.se
Tue Jan 18 15:57:23 CET 2011

Patrick Georgi wrote:
> > > +		if(!fwrite(cmos_table, (int)(ct->size-1), 1, fp)) {
> > 
> > It would be better to check that all bytes have been written not only
> > some, so do something like:
> > 
> > if(fwrite(cmos_table, (int)(ct->size-1), 1, fp) != ct->size-1) {
> fwrite returns the number of successful elements, not bytes. Given that
> there's only 1 element to write (of size ct->size-1),

I have had very bad experience with this, where things did not work
unless element size=1 and number of elements=bytestowrote, so I
continue to write all code that way.

Unfortunately I can't say what the circumstances were, but when I saw
it I decided better be safe. And a smart libc could coalesce anyway.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20110118/16a0f3be/attachment.sig>

More information about the coreboot mailing list