From: Andreas Schwab Date: Mon, 13 Feb 2012 20:39:46 +0000 (+0100) Subject: * gnutls.c (emacs_gnutls_write): Fix last change. X-Git-Tag: emacs-pretest-24.0.94~148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ca43699556cef0f6fb46f70b66b39b71d14d85b;p=emacs.git * gnutls.c (emacs_gnutls_write): Fix last change. --- diff --git a/src/ChangeLog b/src/ChangeLog index b4af412ed7b..7893cd68396 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-02-13 Andreas Schwab + + * gnutls.c (emacs_gnutls_write): Fix last change. + 2012-02-13 Lars Ingebrigtsen * gnutls.c (emacs_gnutls_write): Set errno appropriately for diff --git a/src/gnutls.c b/src/gnutls.c index 84ceeaf3119..6b5cb47001b 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -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;