mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
Changes for libuv bug reproduce.
This commit is contained in:
parent
776b006342
commit
91551d2f5a
@ -168,9 +168,10 @@
|
||||
/* u2_save: checkpoint control.
|
||||
*/
|
||||
typedef struct _u2_save {
|
||||
uv_timer_t tim_u; // checkpoint timer
|
||||
c3_w ent_w; // event number, XX 64
|
||||
c3_w pid_w; // pid of checkpoint process
|
||||
uv_timer_t tim_u; // checkpoint timer
|
||||
uv_signal_t sil_u; // child signal
|
||||
c3_w ent_w; // event number, XX 64
|
||||
c3_w pid_w; // pid of checkpoint process
|
||||
} u2_save;
|
||||
|
||||
/* u2_ubuf: unix tty i/o buffer.
|
||||
|
15
v/save.c
15
v/save.c
@ -17,6 +17,19 @@
|
||||
#include "all.h"
|
||||
#include "v/vere.h"
|
||||
|
||||
/* _save_sign_cb: signal callback.
|
||||
*/
|
||||
static void
|
||||
_save_sign_cb(uv_signal_t* sil_u, c3_i num_i)
|
||||
{
|
||||
uL(fprintf(uH, "save: signal %d\n", num_i));
|
||||
{
|
||||
switch ( num_i ) {
|
||||
case SIGCHLD: u2_save_ef_chld(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* _save_time_cb(): timer callback.
|
||||
*/
|
||||
static void
|
||||
@ -90,6 +103,8 @@ u2_save_io_init(void)
|
||||
|
||||
uv_timer_init(u2L, &sav_u->tim_u);
|
||||
uv_timer_start(&sav_u->tim_u, _save_time_cb, 5000, 5000);
|
||||
|
||||
uv_signal_start(&sav_u->sil_u, _save_sign_cb, SIGCHLD);
|
||||
}
|
||||
|
||||
/* u2_save_io_exit(): terminate save I/O.
|
||||
|
6
v/unix.c
6
v/unix.c
@ -1189,13 +1189,15 @@ _unix_sign_cb(uv_signal_t* sil_u, c3_i num_i)
|
||||
u2_lo_open();
|
||||
{
|
||||
switch ( num_i ) {
|
||||
default: fprintf(stderr, "\r\nmysterious signal %d\r\n", num_i); break;
|
||||
|
||||
case SIGTERM:
|
||||
fprintf(stderr, "\r\ncaught signal %d\r\n", num_i);
|
||||
u2_Host.liv = u2_no;
|
||||
break;
|
||||
case SIGINT: u2_term_ef_ctlc(); break;
|
||||
case SIGWINCH: u2_term_ef_winc(); break;
|
||||
case SIGCHLD: u2_save_ef_chld(); break;
|
||||
// case SIGCHLD: u2_save_ef_chld(); break;
|
||||
}
|
||||
}
|
||||
u2_lo_shut(u2_yes);
|
||||
@ -1268,6 +1270,7 @@ u2_unix_io_init(void)
|
||||
sig_u->nex_u = unx_u->sig_u;
|
||||
unx_u->sig_u = sig_u;
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
u2_usig* sig_u;
|
||||
|
||||
@ -1278,6 +1281,7 @@ u2_unix_io_init(void)
|
||||
sig_u->nex_u = unx_u->sig_u;
|
||||
unx_u->sig_u = sig_u;
|
||||
}
|
||||
#endif
|
||||
u2_unix_ef_move();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user