mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 20:04:09 +03:00
Handle autosave SIGCHLD with no stored pid
This commit is contained in:
parent
2b7f998611
commit
abac35c6eb
15
v/save.c
15
v/save.c
@ -29,14 +29,13 @@ _save_time_cb(uv_timer_t* tim_u, c3_i sas_i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( u2A->ent_w > sav_u->ent_w ) {
|
if ( u2A->ent_w > sav_u->ent_w ) {
|
||||||
c3_w pid_w;
|
|
||||||
|
|
||||||
// uL(fprintf(uH, "autosaving... ent_w %d\n", u2A->ent_w));
|
// uL(fprintf(uH, "autosaving... ent_w %d\n", u2A->ent_w));
|
||||||
|
|
||||||
u2_cm_purge();
|
u2_cm_purge();
|
||||||
// u2_ve_grab(0);
|
// u2_ve_grab(0);
|
||||||
|
|
||||||
#ifdef FORKPT
|
#ifdef FORKPT
|
||||||
|
c3_w pid_w;
|
||||||
if ( 0 == (pid_w = fork()) ) {
|
if ( 0 == (pid_w = fork()) ) {
|
||||||
u2_loom_save(u2A->ent_w);
|
u2_loom_save(u2A->ent_w);
|
||||||
exit(0);
|
exit(0);
|
||||||
@ -63,10 +62,18 @@ u2_save_ef_chld(void)
|
|||||||
c3_i loc_i;
|
c3_i loc_i;
|
||||||
c3_w pid_w;
|
c3_w pid_w;
|
||||||
|
|
||||||
c3_assert(0 != sav_u->pid_w);
|
/* modified for cases with no pid_w
|
||||||
|
*/
|
||||||
uL(fprintf(uH, "checkpoint: complete %d\n", sav_u->pid_w));
|
uL(fprintf(uH, "checkpoint: complete %d\n", sav_u->pid_w));
|
||||||
pid_w = wait(&loc_i);
|
pid_w = wait(&loc_i);
|
||||||
c3_assert(pid_w == sav_u->pid_w);
|
if (0 != sav_u->pid_w)
|
||||||
|
{
|
||||||
|
c3_assert(pid_w == sav_u->pid_w);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c3_assert(pid_w > 0);
|
||||||
|
}
|
||||||
|
|
||||||
sav_u->pid_w = 0;
|
sav_u->pid_w = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user