tboot/tboot-1.7.0-zlib-fix.patch
Gang Wei 2d31b682d8 Fix build with latest zilb 1.2.7.
Signed-off-by: Gang Wei <gang.wei@intel.com>
2012-08-22 01:40:07 -04:00

43 lines
1.2 KiB
Diff

diff -r 7db3c64d7b75 lcptools/mlehash.c
--- a/lcptools/mlehash.c Wed Aug 22 11:49:46 2012 +0800
+++ b/lcptools/mlehash.c Wed Aug 22 12:14:03 2012 +0800
@@ -233,7 +233,7 @@
*/
static bool read_file(const char *filename, void **buffer, size_t *length)
{
- FILE *fcompressed = NULL;
+ gzFile fcompressed = NULL;
FILE *fdecompressed = NULL;
struct stat filestat;
char tmpbuffer[1024];
diff -r 7db3c64d7b75 tb_polgen/commands.c
--- a/tb_polgen/commands.c Wed Aug 22 11:49:46 2012 +0800
+++ b/tb_polgen/commands.c Wed Aug 22 12:14:03 2012 +0800
@@ -60,7 +60,7 @@
int read_cnt;
if ( unzip )
- f = gzopen(filename, "rb");
+ f = (FILE *)gzopen(filename, "rb");
else
f = fopen(filename, "rb");
@@ -73,7 +73,7 @@
EVP_DigestInit(&ctx, md);
do {
if ( unzip )
- read_cnt = gzread(f, buf, sizeof(buf));
+ read_cnt = gzread((gzFile)f, buf, sizeof(buf));
else
read_cnt = fread(buf, 1, sizeof(buf), f);
if ( read_cnt == 0 )
@@ -84,7 +84,7 @@
EVP_DigestFinal(&ctx, hash->sha1, NULL);
if ( unzip )
- gzclose(f);
+ gzclose((gzFile)f);
else
fclose(f);