+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
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;
{
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;