From: Lars Magne Ingebrigtsen Date: Sat, 9 Oct 2010 13:54:57 +0000 (+0200) Subject: (emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~46^2~103 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e6c74c53fbb318aa13144681400f3f80e3529f7;p=emacs.git (emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR. According to the documentation, this is correct, and it seems to make things work. --- diff --git a/src/ChangeLog b/src/ChangeLog index b147ab2d01f..dc80a88def3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5,6 +5,9 @@ (emacs_gnutls_read): Return -1 if we got an error from gnutls_read(). This allows us to actually read lots of data from the GnuTLS stream. + (emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR. + According to the documentation, this is correct, and it seems to + make things work. 2010-10-09 Chong Yidong diff --git a/src/gnutls.c b/src/gnutls.c index da5b10d3190..d9ccaa5a62c 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -86,9 +86,9 @@ emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf, { rtnval = gnutls_write (state, buf, nbyte); - if (rtnval == -1) + if (rtnval < 0) { - if (errno == EINTR) + if (rtnval == GNUTLS_E_AGAIN || rtnval == GNUTLS_E_INTERRUPTED) continue; else return (bytes_written ? bytes_written : -1);