Commit 0ca43699 authored by Andreas Schwab's avatar Andreas Schwab

* gnutls.c (emacs_gnutls_write): Fix last change.

parent 5f0af64f
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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment