From 2137f4f78f2b80faf96707907cd08562d83f1216 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 3 Jul 2012 14:52:26 +0000 Subject: GnuTLS 3.x has removed gnutls_transport_set_global_errno() in favour of gnutls_transport_set_errno(). Make sure we call the right errno function depending on which GnuTLS we're using. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4922 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rdr/TLSInStream.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'common/rdr/TLSInStream.cxx') diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx index e553085f..4d2c9ecb 100644 --- a/common/rdr/TLSInStream.cxx +++ b/common/rdr/TLSInStream.cxx @@ -25,12 +25,9 @@ #include #include #include +#include #include -#ifdef HAVE_OLD_GNUTLS -#define gnutls_transport_set_global_errno(A) do { errno = (A); } while(0) -#endif - #ifdef HAVE_GNUTLS using namespace rdr; @@ -43,7 +40,7 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr str, void* data, size_t size) try { if (!in->check(1, 1, false)) { - gnutls_transport_set_global_errno(EAGAIN); + gnutls_errno_helper(self->session, EAGAIN); return -1; } @@ -53,7 +50,7 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr str, void* data, size_t size) in->readBytes(data, size); } catch (Exception& e) { - gnutls_transport_set_global_errno(EINVAL); + gnutls_errno_helper(self->session, EINVAL); return -1; } -- cgit v1.2.3