diff options
| author | Lars Ingebrigtsen | 2012-02-13 20:37:48 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2012-02-13 20:37:48 +0100 |
| commit | 2e8f3c56f0217d29ce9e229268331cef2a1e8739 (patch) | |
| tree | bc202f811b739f49d013ca85c2c0b43063122f1e /src | |
| parent | 6c0c7cfc6755342c15e0230747d7f0c697c899d9 (diff) | |
| download | emacs-2e8f3c56f0217d29ce9e229268331cef2a1e8739.tar.gz emacs-2e8f3c56f0217d29ce9e229268331cef2a1e8739.zip | |
Further GnuTLS EAGAIN write fixups
* gnutls.c (emacs_gnutls_write): Set errno appropriately for
send_process.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/gnutls.c | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d9c02e011ad..b4af412ed7b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnutls.c (emacs_gnutls_write): Set errno appropriately for | ||
| 4 | send_process. | ||
| 5 | |||
| 1 | 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * keymap.c (Fsingle_key_description): Handle char ranges. | 8 | * keymap.c (Fsingle_key_description): Handle char ranges. |
diff --git a/src/gnutls.c b/src/gnutls.c index 5da84bdd960..84ceeaf3119 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -365,8 +365,20 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte) | |||
| 365 | { | 365 | { |
| 366 | if (rtnval == GNUTLS_E_INTERRUPTED) | 366 | if (rtnval == GNUTLS_E_INTERRUPTED) |
| 367 | continue; | 367 | continue; |
| 368 | else | 368 | else { |
| 369 | /* If we get EAGAIN, then set errno appropriately so that | ||
| 370 | send_process retries the correct way instead of | ||
| 371 | erroring out. */ | ||
| 372 | if (rtnval == EAGAIN) { | ||
| 373 | #ifdef EWOULDBLOCK | ||
| 374 | errno = EWOULDBLOCK; | ||
| 375 | #endif | ||
| 376 | #ifdef EAGAIN | ||
| 377 | errno = EAGAIN; | ||
| 378 | #endif | ||
| 379 | } | ||
| 369 | break; | 380 | break; |
| 381 | } | ||
| 370 | } | 382 | } |
| 371 | 383 | ||
| 372 | buf += rtnval; | 384 | buf += rtnval; |