]> skyeroc.xyz Git - dgamelaunch/commitdiff
More signal handling, this time for when running the game.
authorPasi Kallinen <paxed@alt.org>
Sun, 16 May 2010 19:14:35 +0000 (19:14 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 16 May 2010 19:14:35 +0000 (19:14 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@571 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgl-common.c

index 383e2293d79f311ba5e4dabc07c883105cf50838..4e3bd3f0869952ec7e6393dfc92177fc5c467a6f 100644 (file)
@@ -346,7 +346,6 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
                            clear();
                            refresh();
                            endwin ();
-                           signal(SIGWINCH, SIG_DFL);
 
                            /* first run the generic "do these when a game is started" commands */
                            dgl_exec_cmdqueue(globalconfig.cmdqueue[DGLTIME_GAMESTART], userchoice, me);
@@ -360,17 +359,24 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
                                myconfig[userchoice]->bin_args[i] = tmpstr;
                            }
 
-                           signals_block();
+                           signal(SIGWINCH, SIG_DFL);
+                           signal(SIGINT, SIG_DFL);
+                           signal(SIGQUIT, SIG_DFL);
+                           signal(SIGTERM, SIG_DFL);
                            idle_alarm_set_enabled(0);
                            /* launch program */
                            ttyrec_main (userchoice, me->username,
                                         dgl_format_str(userchoice, me, myconfig[userchoice]->ttyrecdir, NULL),
                                         gen_ttyrec_filename());
-
+                           idle_alarm_set_enabled(1);
                            /* lastly, run the generic "do these when a game is left" commands */
+                           signal (SIGHUP, catch_sighup);
+                           signal (SIGINT, catch_sighup);
+                           signal (SIGQUIT, catch_sighup);
+                           signal (SIGTERM, catch_sighup);
+                           signal(SIGWINCH, sigwinch_func);
+
                            dgl_exec_cmdqueue(globalconfig.cmdqueue[DGLTIME_GAMEEND], userchoice, me);
-                           idle_alarm_set_enabled(1);
-                           signals_release();
 
                            setproctitle ("%s", me->username);
                            initcurses ();