diff --git a/dgamelaunch.c b/dgamelaunch.c index 174b5df..f551f92 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -2277,7 +2277,6 @@ runmenuloop(struct dg_menu *menu) ban.lines = NULL; ban.len = 0; - idle_alarm_set_enabled(1); loadbanner(menu->banner_fn, &ban); while (1) { if (doclear) { @@ -2545,11 +2544,15 @@ main (int argc, char** argv) initcurses (); term_resize_check(); + idle_alarm_set_enabled(1); + while (1) { if (runmenuloop(dgl_find_menu(loggedin ? "mainmenu_user" : "mainmenu_anon"))) break; } + idle_alarm_set_enabled(0); + /* NOW we can safely kill this */ freefile (); diff --git a/dgl-common.c b/dgl-common.c index 4e3bd3f..d004f4a 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -273,14 +273,13 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me) debug_write("exec-command fork failed"); graceful_exit(114); } else if (child == 0) { - signals_block(); execvp(p1, myargv); - signals_release(); exit(0); } else waitpid(child, NULL, 0); idle_alarm_set_enabled(1); initcurses(); + clear(); refresh(); check_retard(1); } @@ -380,6 +379,8 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me) setproctitle ("%s", me->username); initcurses (); + clear(); + refresh(); check_retard(1); /* reset retard counter */ } break; diff --git a/ttyrec.c b/ttyrec.c index 225b4f6..2056c85 100644 --- a/ttyrec.c +++ b/ttyrec.c @@ -239,16 +239,16 @@ finish (int sig) if (die) { - if (wait_for_menu && input_child) + if (input_child) { // Need to kill the child that's writing input to pty. kill(input_child, SIGTERM); while ((pid = wait3(&status, WNOHANG, 0)) > 0); - wait_for_menu = 0; } else done (); } + wait_for_menu = 0; } void @@ -408,4 +408,5 @@ remove_ipfile (void) free(ipfile); ipfile = NULL; } + signal(SIGALRM, SIG_IGN); }