mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
Fix bus errors with proper truncation.
This commit is contained in:
parent
9c51f2cc10
commit
33430d9fbc
14
f/loom.c
14
f/loom.c
@ -197,6 +197,18 @@ _loom_deploy(void)
|
||||
return u2_yes;
|
||||
}
|
||||
|
||||
/* u2_loom_exit(): return checkpoint files to their natural size.
|
||||
*/
|
||||
void
|
||||
u2_loom_exit(void)
|
||||
{
|
||||
u2_cheg* ceg_u;
|
||||
|
||||
for ( ceg_u = &LoomSegmentA; ceg_u; ceg_u = ceg_u->nex_u ) {
|
||||
ftruncate(ceg_u->dat_i, (ceg_u->pgs_w << (LoomPageWords + 2)));
|
||||
}
|
||||
}
|
||||
|
||||
/* u2_loom_save(): checkpoint at current date, with hat and mat.
|
||||
*/
|
||||
u2_bean
|
||||
@ -239,7 +251,7 @@ u2_loom_save(c3_w ent_w)
|
||||
num_w++;
|
||||
}
|
||||
}
|
||||
ftruncate(ceg_u->dat_i, (ceg_u->pgs_w << (LoomPageWords + 2)));
|
||||
// ftruncate(ceg_u->dat_i, (ceg_u->pgs_w << (LoomPageWords + 2)));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user