diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gnutls.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 3c16b6c9c31..b724c3592d0 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -753,8 +753,15 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, ptrdiff_t nbyte) | |||
| 753 | /* The peer closed the connection. */ | 753 | /* The peer closed the connection. */ |
| 754 | return 0; | 754 | return 0; |
| 755 | else if (emacs_gnutls_handle_error (state, rtnval)) | 755 | else if (emacs_gnutls_handle_error (state, rtnval)) |
| 756 | /* non-fatal error */ | 756 | { |
| 757 | return -1; | 757 | /* If we get GNUTLS_E_AGAIN, then set errno appropriately so that |
| 758 | wait_reading_process_output retries the correct way instead of | ||
| 759 | erroring out. */ | ||
| 760 | if (rtnval == GNUTLS_E_AGAIN) | ||
| 761 | errno = EAGAIN; | ||
| 762 | /* non-fatal error */ | ||
| 763 | return -1; | ||
| 764 | } | ||
| 758 | else { | 765 | else { |
| 759 | /* a fatal error occurred */ | 766 | /* a fatal error occurred */ |
| 760 | return 0; | 767 | return 0; |