diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2015-06-10 09:38:38 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-06-10 09:43:51 +0200 |
commit | 03f6d2aaec860d89e3d6280fa31dd03ed6a8f435 (patch) | |
tree | f78cfa4db944971f66e668caa6dc0c15d44825eb | |
parent | f079af0c0f59f00c79808cca931425e848d43efa (diff) |
Call: Handle select(2) returning EINTR.
This may happen when call is running in curses mode, and the terminal
window is resized which results in a SIGWINCH sent. Ncurses as normally
configured on Linux distributions will have installed a handler. If
as it is the most likely case, the select call will be interrupted by
the signal, select will return EINTR and call will exit.
Note that this doesn't mean it's now a good idea to resize the window.
Call will still not handle the screen size change properly and the output
will look ugly and missformatted.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | call/call.c | 13 |
2 files changed, 10 insertions, 5 deletions
@@ -16,6 +16,8 @@ ax25-apps (0.0.8) * Fix grammar of bpqether log message. * Support all standard baud rates from 50 to 4000000 bits per second with ax25ipd. + * call: Do not exit when running in curses mode and the window is + resized. ax25-apps (0.0.7) * Added opentrac to listen, Thanks to Scott Miller diff --git a/call/call.c b/call/call.c index e6adbc7..f7a7770 100644 --- a/call/call.c +++ b/call/call.c @@ -1648,12 +1648,15 @@ int cmd_call(char *call[], int mode) FD_SET(fd, &sock_write); if (select(fd + 1, &sock_read, &sock_write, NULL, (uploadfile == -1 && downloadfile == -1 && inactivity_timeout_is_set == FALSE) ? NULL : &tv) == -1) { - if (!interrupted && errno == EAGAIN) { - usleep(100000); - continue; - } - if (!interrupted) + if (!interrupted) { + if (errno == EINTR) + continue; + if (errno == EAGAIN) { + usleep(100000); + continue; + } perror("select"); + } break; } if (inactivity_timeout_is_set == TRUE && !FD_ISSET(fd, &sock_read) && !FD_ISSET(STDIN_FILENO, &sock_read)) { |