signal handler is called with at least 1 arg */ ARGUSED*/
| 358 | /* signal handler is called with at least 1 arg */ |
| 359 | /*ARGUSED*/ |
| 360 | static void |
| 361 | winch_handler(int sig_unused UNUSED) |
| 362 | { |
| 363 | #ifdef WINCHAIN |
| 364 | { |
| 365 | #define WINCH_MESSAGE "(SIGWINCH)" |
| 366 | if (wc_tracelogf) |
| 367 | (void) write(fileno(wc_tracelogf), WINCH_MESSAGE, |
| 368 | sizeof WINCH_MESSAGE - sizeof ""); |
| 369 | #undef WINCH_MESSAGE |
| 370 | } |
| 371 | #endif |
| 372 | |
| 373 | program_state.resize_pending++; /* resize_tty() will reset it */ |
| 374 | /* if nethack is waiting for input, which is the most likely scenario, |
| 375 | we will go ahead and respond to the resize immediately; otherwise, |
| 376 | tty_nhgetch() will do so the next time it's called */ |
| 377 | if (program_state.getting_char) { |
| 378 | resize_tty(); |
| 379 | #if 0 /* [this doesn't work as intended and seems to be unnecessary] */ |
| 380 | if (resize_mesg) { |
| 381 | /* resize_tty() put "Press a key to continue: " on top line */ |
| 382 | (void) tty_nhgetch(); /* recursion... */ |
| 383 | } |
| 384 | #endif |
| 385 | } |
| 386 | return; |
| 387 | } |
| 388 | |
| 389 | /* query the system for tty size (vis getwindowsz()), and adapt the game's |
| 390 | windows to match */ |
nothing calls this directly
no test coverage detected