bbennett-ks opened a new pull request, #644:
URL: https://github.com/apache/guacamole-server/pull/644
## Summary
This PR hardens guac_wait_for_fd() against signal interruption (EINTR). This
is a subset of GUACAMOLE-2238.
When a signal is delivered (e.g. when a child process exits), some blocking
syscalls can return early with -1 with **errno = EINTR** . This is not a hard
failure: the syscall should be retried.
This PR adds EINTR retry loops around blocking calls in various
guacamole-server. Equivalent handling for the Windows equivalent was also added.
Without retry, signal (async) delivery can cause **guac_wait_for_fd()** to
intermittently fail.
# select Handling
` int select(int nfds, fd_set *_Nullable restrict readfds,
fd_set *_Nullable restrict writefds,
fd_set *_Nullable restrict exceptfds,
struct timeval *_Nullable restrict timeout);
`
Special care has been taken with the **select** system call, as it has
parameters which are modified by the system: how these parameters are handled
on retry must be considered. Based on the Linux man page:
`On error, -1 is returned, and is set to indicate the error;
the file descriptor sets are unmodified, and timeout becomes
undefined.`
**select** retry is based on this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]