Mercurial > hvf > hvf-old
changeset 483:5a7da2858417
installer: print the last record (if it is incomplete)
If the file size is not a multiple of LRECL, the last record was written to
the file, but the the user was not informed about it.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Wed, 20 Apr 2011 20:19:56 -0400 |
parents | 243c6083ee1d |
children | 25abe8a2c816 |
files | installer/cpio.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/installer/cpio.c Wed Apr 20 20:18:56 2011 -0400 +++ b/installer/cpio.c Wed Apr 20 20:19:56 2011 -0400 @@ -86,8 +86,11 @@ u8 buf2[te->lrecl]; memset(buf2, 0, te->lrecl); - memcpy(buf2, buf + (rec * te->lrecl), te->lrecl); + memcpy(buf2, buf + (rec * te->lrecl), filesize % te->lrecl); + snprintf(pbuf, 100, "rec %03x at %p\n", rec, + buf + (rec * te->lrecl)); + wto(pbuf); append_record(&fst, buf2); } }