]> git.eshelyaron.com Git - emacs.git/commitdiff
Further GnuTLS EAGAIN write fixups
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Feb 2012 19:37:48 +0000 (20:37 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Feb 2012 19:37:48 +0000 (20:37 +0100)
* gnutls.c (emacs_gnutls_write): Set errno appropriately for
send_process.

src/ChangeLog
src/gnutls.c

index d9c02e011ad8250c85da17e33905a2c3b833e674..b4af412ed7be07b2f1673a5d7af285c8322c39be 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * gnutls.c (emacs_gnutls_write): Set errno appropriately for
+       send_process.
+
 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * keymap.c (Fsingle_key_description): Handle char ranges.
index 5da84bdd960f6ac787cb7de2d0ce16b54f26f815..84ceeaf3119c3d1be669c37f5bbabd223eed4248 100644 (file)
@@ -365,8 +365,20 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte)
        {
          if (rtnval == GNUTLS_E_INTERRUPTED)
            continue;
-         else
+         else {
+           /* If we get EAGAIN, then set errno appropriately so that
+              send_process retries the correct way instead of
+              erroring out. */
+           if (rtnval == EAGAIN) {
+#ifdef EWOULDBLOCK
+             errno = EWOULDBLOCK;
+#endif
+#ifdef EAGAIN
+             errno = EAGAIN;
+#endif
+           }
            break;
+         }
        }
 
       buf += rtnval;