[U-Boot] [PATCH v2 5/7] tools: add padding of data image file for imximage

Stefano Babic sbabic at denx.de
Mon Aug 19 13:17:04 CEST 2013


Hi Marek,

On 13/08/2013 07:10, Marek Vasut wrote:
> Dear Stefano Babic,
> 
>> Implement function vrec_header to be able to pad the final
>> data image file according the what has been calculated for
>> boot_data.length.
>>
>> Signed-off-by: Stefano Babic <sbabic at denx.de>
>> ---
> 
> [...]
> 
>> +	if (!imxhdr) {
>> +		fprintf(stderr, "%s: malloc return failure: %s\n",
>> +			params->cmdname, strerror(errno));
>> +		exit(EXIT_FAILURE);
>> +	}
>> +
>> +	memset(imxhdr, 0, alloc_len);
>> +
>> +	tparams->header_size = alloc_len;
>> +	tparams->hdr         = imxhdr;
>> +
>> +	/* determine data image file length */
> 
> Why dont you just call stat(2) here instead of the open+fstat+close combo?

Thanks, replaced in V3.

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list