I was looking at backporting an X11 build fix to 3.6 and decided
that the hangup handling wasn't correct if SAFERHANGUP is defined
(which it is by default). It didn't attempt to perform a hangup
save. Also, the handler might return when the X code calling it
expected it to not do so.
I don't know how to force a hangup within X11 so haven't tested
this properly. It works fine when there's no hangup. :-/
must continue running longer before attempting a hangup save. */
gp.program_state.done_hup++;
/* defer hangup iff game appears to be in progress */
- if (gp.program_state.in_moveloop && gp.program_state.something_worth_saving)
+ if (gp.program_state.in_moveloop
+ && gp.program_state.something_worth_saving)
return;
#endif /* SAFERHANGUP */
end_of_input();
{
nhUse(str);
hangup(1);
- nh_terminate(EXIT_FAILURE);
+#ifdef SAFERHANGUP /* keeps going after hangup() for '#if SAFERHANGUP' */
+ end_of_input();
+#endif
/*NOTREACHED*/
+ nh_terminate(EXIT_FAILURE);
}
static int
{
nhUse(display);
hangup(1);
+#ifdef SAFERHANGUP /* keeps going after hangup() for '#if SAFERHANGUP' */
+ end_of_input();
+#endif
+ /*NOREACHED*/ /* but not declared NORETURN */
return 0;
}