diff options
| author | Paul Eggert | 2019-01-15 23:51:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-01-15 23:52:47 -0800 |
| commit | e87e6a24c49542111e669b7d0f1a412024663f8e (patch) | |
| tree | ba382d326874795c7b131a7995c67e660650a80c /src/bytecode.c | |
| parent | 6b9fa8804533a695094a930d634d2d6617e2b6c7 (diff) | |
| download | emacs-e87e6a24c49542111e669b7d0f1a412024663f8e.tar.gz emacs-e87e6a24c49542111e669b7d0f1a412024663f8e.zip | |
Fix unlikely races with GnuTLS, datagrams
Retry some calls if interrupted at inopportune times.
These were found by code inspection.
* src/gnutls.c (gnutls_try_handshake): Simplify by using
new emacs_gnutls_handle_error API.
(emacs_gnutls_write): Remove GNUTLS_E_AGAIN hack since
emacs_gnutls_handle_error now does that.
Use emacs_gnutls_handle_error only on errors.
(emacs_gnutls_read): Retry if gnutls_record_recv returns
GNUTLS_E_INTERRUPTED, to be consistent with emacs_read.
(emacs_gnutls_handle_error): Return 0 on fatal errors,
-1 (setting errno) on ordinary errors, to simplify callers.
Assume that ERR is negative, since it always is now.
Map non-fatal GnuTLS errors to errno values as best we can.
* src/process.c (read_process_output) [DATAGRAM_SOCKETS]:
Retry recvfrom if it is interrupted, to be consistent with
how things are handled when not a datagram channel.
(send_process) [DATAGRAM_SOCEKTS]: If sendto is interrupted,
process pending signals and retry it, to be consistent with
how things are handled when not a datagram channel.
Diffstat (limited to 'src/bytecode.c')
0 files changed, 0 insertions, 0 deletions