]> code.delx.au - gnu-emacs/commitdiff
* gnutls.c (emacs_gnutls_write): Fix last change.
authorAndreas Schwab <schwab@linux-m68k.org>
Mon, 13 Feb 2012 20:39:46 +0000 (21:39 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Mon, 13 Feb 2012 20:39:46 +0000 (21:39 +0100)
src/ChangeLog
src/gnutls.c

index b4af412ed7be07b2f1673a5d7af285c8322c39be..7893cd68396f498062059f3e1bbfd7a6238b98c7 100644 (file)
@@ -1,3 +1,7 @@
+2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * gnutls.c (emacs_gnutls_write): Fix last change.
+
 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * gnutls.c (emacs_gnutls_write): Set errno appropriately for
index 84ceeaf3119c3d1be669c37f5bbabd223eed4248..6b5cb47001b24793c32fc98c41747fdbf0750199 100644 (file)
@@ -345,15 +345,16 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte)
   EMACS_INT bytes_written;
   gnutls_session_t state = proc->gnutls_state;
 
-  if (proc->gnutls_initstage != GNUTLS_STAGE_READY) {
+  if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
+    {
 #ifdef EWOULDBLOCK
-    errno = EWOULDBLOCK;
+      errno = EWOULDBLOCK;
 #endif
 #ifdef EAGAIN
-    errno = EAGAIN;
+      errno = EAGAIN;
 #endif
-    return 0;
-  }
+      return 0;
+    }
 
   bytes_written = 0;
 
@@ -365,20 +366,22 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte)
        {
          if (rtnval == GNUTLS_E_INTERRUPTED)
            continue;
-         else {
-           /* If we get EAGAIN, then set errno appropriately so that
-              send_process retries the correct way instead of
-              erroring out. */
-           if (rtnval == EAGAIN) {
+         else
+           {
+             /* If we get GNUTLS_E_AGAIN, then set errno
+                appropriately so that send_process retries the
+                correct way instead of erroring out. */
+             if (rtnval == GNUTLS_E_AGAIN)
+               {
 #ifdef EWOULDBLOCK
-             errno = EWOULDBLOCK;
+                 errno = EWOULDBLOCK;
 #endif
 #ifdef EAGAIN
-             errno = EAGAIN;
+                 errno = EAGAIN;
 #endif
+               }
+             break;
            }
-           break;
-         }
        }
 
       buf += rtnval;