From: Paul Eggert Date: Wed, 3 Aug 2016 11:45:47 +0000 (-0400) Subject: Port to systems lacking GNUTLS_NONBLOCK X-Git-Tag: emacs-26.0.90~1808 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=744cc9fa17d20450fc3cf1ca6bb71869abeeb77b;p=emacs.git Port to systems lacking GNUTLS_NONBLOCK Problem reported by Colin Baxter in: http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00096.html * src/gnutls.c (Fgnutls_boot): Don’t assume GNUTLS_NONBLOCK is defined. --- diff --git a/src/gnutls.c b/src/gnutls.c index e3e9311c48d..bc35dfb4116 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -1602,8 +1602,12 @@ one trustfile (usually a CA bundle). */) /* Call gnutls_init here: */ GNUTLS_LOG (1, max_log_level, "gnutls_init"); - int nonblock = XPROCESS (proc)->is_non_blocking_client ? GNUTLS_NONBLOCK : 0; - ret = gnutls_init (&state, GNUTLS_CLIENT | nonblock); + int gnutls_flags = GNUTLS_CLIENT; +#ifdef GNUTLS_NONBLOCK + if (XPROCESS (proc)->is_non_blocking_client) + gnutls_flags |= GNUTLS_NONBLOCK; +#endif + ret = gnutls_init (&state, gnutls_flags); XPROCESS (proc)->gnutls_state = state; if (ret < GNUTLS_E_SUCCESS) return gnutls_make_error (ret);