mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 20:47:27 +03:00
Revert "Fork a child to handle checkpointing."
This reverts commit 3fa73e4e350878c8dcf4c0a2f305f7a528c4a2c3.
This commit is contained in:
parent
23aced9775
commit
f725293d6d
2
Makefile
2
Makefile
@ -54,7 +54,7 @@ LIBS=-lssl -lcrypto -lgmp -lncurses -lsigsegv $(OSLIBS)
|
||||
|
||||
INCLUDE=include
|
||||
GENERATED=generated
|
||||
MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\" -DFORKPT
|
||||
MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\"
|
||||
|
||||
CFLAGS=-O3 \
|
||||
-I/usr/local/include \
|
||||
|
16
v/save.c
16
v/save.c
@ -23,8 +23,12 @@
|
||||
static void
|
||||
_save_sign_cb(uv_signal_t* sil_u, c3_i num_i)
|
||||
{
|
||||
c3_assert(SIGCHLD == num_i);
|
||||
u2_save_ef_chld();
|
||||
uL(fprintf(uH, "save: signal %d\n", num_i));
|
||||
{
|
||||
switch ( num_i ) {
|
||||
case SIGCHLD: u2_save_ef_chld(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* _save_time_cb(): timer callback.
|
||||
@ -51,7 +55,7 @@ _save_time_cb(uv_timer_t* tim_u, c3_i sas_i)
|
||||
exit(0);
|
||||
}
|
||||
else {
|
||||
// uL(fprintf(uH, "checkpoint: process %d\n", pid_w));
|
||||
uL(fprintf(uH, "checkpoint: process %d\n", pid_w));
|
||||
|
||||
sav_u->ent_w = u2A->ent_w;
|
||||
sav_u->pid_w = pid_w;
|
||||
@ -74,14 +78,13 @@ u2_save_ef_chld(void)
|
||||
|
||||
/* 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);
|
||||
if (0 != sav_u->pid_w) {
|
||||
c3_assert(pid_w == sav_u->pid_w);
|
||||
}
|
||||
else {
|
||||
c3_assert(pid_w > 0);
|
||||
c3_assert(WIFEXITED(pid_w) && 0 == WEXITSTATUS(pid_w));
|
||||
}
|
||||
sav_u->pid_w = 0;
|
||||
}
|
||||
@ -99,10 +102,7 @@ u2_save_io_init(void)
|
||||
uv_timer_init(u2L, &sav_u->tim_u);
|
||||
uv_timer_start(&sav_u->tim_u, _save_time_cb, 15000, 15000);
|
||||
|
||||
#ifdef FORKPT
|
||||
uv_signal_init(u2L, &sav_u->sil_u);
|
||||
uv_signal_start(&sav_u->sil_u, _save_sign_cb, SIGCHLD);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* u2_save_io_exit(): terminate save I/O.
|
||||
|
Loading…
Reference in New Issue
Block a user