diff options
| author | Andreas Schwab | 2012-02-13 21:39:46 +0100 |
|---|---|---|
| committer | Andreas Schwab | 2012-02-13 21:39:46 +0100 |
| commit | 0ca43699556cef0f6fb46f70b66b39b71d14d85b (patch) | |
| tree | 18bb68b7adae4db1254f3bd296abebb309ae1322 /src | |
| parent | 5f0af64f87f6b9fdf46bf3dedfeaed5f1739e5ff (diff) | |
| download | emacs-0ca43699556cef0f6fb46f70b66b39b71d14d85b.tar.gz emacs-0ca43699556cef0f6fb46f70b66b39b71d14d85b.zip | |
* gnutls.c (emacs_gnutls_write): Fix last change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/gnutls.c | 31 |
2 files changed, 21 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b4af412ed7b..7893cd68396 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-02-13 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * gnutls.c (emacs_gnutls_write): Fix last change. | ||
| 4 | |||
| 1 | 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> | 5 | 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 6 | ||
| 3 | * gnutls.c (emacs_gnutls_write): Set errno appropriately for | 7 | * 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) | |||
| 345 | EMACS_INT bytes_written; | 345 | EMACS_INT bytes_written; |
| 346 | gnutls_session_t state = proc->gnutls_state; | 346 | gnutls_session_t state = proc->gnutls_state; |
| 347 | 347 | ||
| 348 | if (proc->gnutls_initstage != GNUTLS_STAGE_READY) { | 348 | if (proc->gnutls_initstage != GNUTLS_STAGE_READY) |
| 349 | { | ||
| 349 | #ifdef EWOULDBLOCK | 350 | #ifdef EWOULDBLOCK |
| 350 | errno = EWOULDBLOCK; | 351 | errno = EWOULDBLOCK; |
| 351 | #endif | 352 | #endif |
| 352 | #ifdef EAGAIN | 353 | #ifdef EAGAIN |
| 353 | errno = EAGAIN; | 354 | errno = EAGAIN; |
| 354 | #endif | 355 | #endif |
| 355 | return 0; | 356 | return 0; |
| 356 | } | 357 | } |
| 357 | 358 | ||
| 358 | bytes_written = 0; | 359 | bytes_written = 0; |
| 359 | 360 | ||
| @@ -365,20 +366,22 @@ emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT nbyte) | |||
| 365 | { | 366 | { |
| 366 | if (rtnval == GNUTLS_E_INTERRUPTED) | 367 | if (rtnval == GNUTLS_E_INTERRUPTED) |
| 367 | continue; | 368 | continue; |
| 368 | else { | 369 | else |
| 369 | /* If we get EAGAIN, then set errno appropriately so that | 370 | { |
| 370 | send_process retries the correct way instead of | 371 | /* If we get GNUTLS_E_AGAIN, then set errno |
| 371 | erroring out. */ | 372 | appropriately so that send_process retries the |
| 372 | if (rtnval == EAGAIN) { | 373 | correct way instead of erroring out. */ |
| 374 | if (rtnval == GNUTLS_E_AGAIN) | ||
| 375 | { | ||
| 373 | #ifdef EWOULDBLOCK | 376 | #ifdef EWOULDBLOCK |
| 374 | errno = EWOULDBLOCK; | 377 | errno = EWOULDBLOCK; |
| 375 | #endif | 378 | #endif |
| 376 | #ifdef EAGAIN | 379 | #ifdef EAGAIN |
| 377 | errno = EAGAIN; | 380 | errno = EAGAIN; |
| 378 | #endif | 381 | #endif |
| 382 | } | ||
| 383 | break; | ||
| 379 | } | 384 | } |
| 380 | break; | ||
| 381 | } | ||
| 382 | } | 385 | } |
| 383 | 386 | ||
| 384 | buf += rtnval; | 387 | buf += rtnval; |