diff --git a/library/changes b/library/changes index 68dca3f..a2f457b 100644 --- a/library/changes +++ b/library/changes @@ -1,3 +1,6 @@ +- To work around a bug in the Roadshow TCP/IP stack (since fixed), the waitselect() + function now substitutes a 10 microsecond timeout for a zero length timeout. + - isatty() no longer crashes if passed a socket rather than a file. - Rewrote the GetRexxVar()/SetRexxVar() functions (mostly) in 'C', using available diff --git a/library/socket_wait_select.c b/library/socket_wait_select.c index cb6fc5d..9b39750 100644 --- a/library/socket_wait_select.c +++ b/library/socket_wait_select.c @@ -1,5 +1,5 @@ /* - * $Id: socket_wait_select.c,v 1.3 2006-04-10 15:08:10 obarthel Exp $ + * $Id: socket_wait_select.c,v 1.4 2008-04-16 07:53:40 obarthel Exp $ * * :ts=4 * @@ -44,8 +44,22 @@ int waitselect(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct timeval *timeout,unsigned long * signal_mask) { + struct timeval other_timeout; int result; + /* This is a workaround for a bug in the Roadshow TCP/IP stack which has been + fixed long ago: if a signal is received, as given in the 'signal_mask' + parameter, the WaitSelect() function may not detect it if the timeout + is zero. */ + if(signal_mask != NULL && timeout != NULL && timeout->tv_secs == 0 && timeout->tv_micro == 0) + { + /* Substitute a ten microsecond timeout. */ + other_timeout.tv_secs = 0; + other_timeout.tv_micro = 10000; + + timeout = &other_timeout; + } + result = __select(num_fds,read_fds,write_fds,except_fds,timeout,signal_mask); return(result);