diff options
author | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2010-10-18 22:32:54 +0200 |
---|---|---|
committer | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2010-10-18 22:32:54 +0200 |
commit | 4b2d9ec26363f78d00a1b2595c7c7a5bdda262d2 (patch) | |
tree | 6c1198074ecb493cd911d01bc087cd009bff22c9 /src/gnutls.c | |
parent | e48eb34332dc91de823314090451459ba2ffacbf (diff) | |
download | emacs-4b2d9ec26363f78d00a1b2595c7c7a5bdda262d2.tar.gz |
(emacs_gnutls_read): Return 0 if we get a non-"EAGAIN"-like error to signal to Emacs that the socket should be closed.
Diffstat (limited to 'src/gnutls.c')
-rw-r--r-- | src/gnutls.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 577cca247ee..1cc258a5096 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -125,8 +125,13 @@ emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, rtnval = gnutls_read (state, buf, nbyte); if (rtnval >= 0) return rtnval; - else - return -1; + else { + if (rtnval == GNUTLS_E_AGAIN || + rtnval == GNUTLS_E_INTERRUPTED) + return -1; + else + return 0; + } } /* convert an integer error to a Lisp_Object; it will be either a |