fixed erroneous error check

This commit is contained in:
Fufu Fang 2024-05-05 03:13:16 +01:00
parent 1a20318654
commit 28293b5ccd
No known key found for this signature in database
GPG Key ID: 8A4CB08B0A7E27CE
1 changed files with 5 additions and 8 deletions

View File

@ -163,14 +163,11 @@ static int Meta_read(Cache *cf)
return EIO;
}
/*
* TODO: This appears to be broken
*/
if (sizeof(long) != fread(&cf->time, sizeof(long), 1, fp) ||
sizeof(off_t) != fread(&cf->content_length, sizeof(off_t), 1, fp) ||
sizeof(int) != fread(&cf->blksz, sizeof(int), 1, fp) ||
sizeof(long) != fread(&cf->segbc, sizeof(long), 1, fp) ||
ferror(fp)) {
if ( 1 != fread(&cf->time, sizeof(long), 1, fp) ||
1 != fread(&cf->content_length, sizeof(off_t), 1, fp) ||
1 != fread(&cf->blksz, sizeof(int), 1, fp) ||
1 != fread(&cf->segbc, sizeof(long), 1, fp) ||
ferror(fp) ) {
lprintf(error, "error reading core metadata %s!\n", cf->path);
return EIO;
}