Bradley Bennett created GUACAMOLE-2239:
------------------------------------------
Summary: guac_wait_for_fd() does not correctly retry on EINTR
Key: GUACAMOLE-2239
URL: https://issues.apache.org/jira/browse/GUACAMOLE-2239
Project: Guacamole
Issue Type: Bug
Components: guacd
Affects Versions: 1.6.0, 1.6.1
Reporter: Bradley Bennett
*guac_wait_for_fd()* can fail when *SIGCHLD* is delivered, e.g. when a child
process exits. This is because signal delivery can cause some blocking systems
calls, such as *poll()* and {*}select(){*}. In this case, the system call fails
(returns -1) and returns {*}EINTR{*}. The proper action is to retry the system
call.
{code:java}
int guac_wait_for_fd(int fd, int usec_timeout) {
...
do {
...
/* Retry if interrupted by a signal (EINTR). */
retval = select(fd + 1, &fds, NULL, NULL, &timeout);
} while (retval < 0 && errno == EINTR); return retval; {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)