]> git.eshelyaron.com Git - emacs.git/commitdiff
(emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 9 Oct 2010 13:54:57 +0000 (15:54 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 9 Oct 2010 13:54:57 +0000 (15:54 +0200)
According to the documentation, this is correct, and it seems to
make things work.

src/ChangeLog
src/gnutls.c

index b147ab2d01ff7fc44d573176720bcfe5ce52e6dc..dc80a88def360bb0f305144b1d61f2ce6844b180 100644 (file)
@@ -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  <cyd@stupidchicken.com>
 
index da5b10d3190bea7db4a8ad3c118dff6c32713796..d9ccaa5a62c49738f6919dd9a34a1d0611bbaf22 100644 (file)
@@ -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);