diff options
author | Pierre Ossman <ossman@cendio.se> | 2012-07-03 14:52:26 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2012-07-03 14:52:26 +0000 |
commit | 2137f4f78f2b80faf96707907cd08562d83f1216 (patch) | |
tree | 6b9c8f1e09c1dd343b65510d853ba9c3e62f1db6 /common/rdr/TLSInStream.cxx | |
parent | fe48cd4d2427c0262cd58b30c74331a9fce756c7 (diff) | |
download | tigervnc-2137f4f78f2b80faf96707907cd08562d83f1216.tar.gz tigervnc-2137f4f78f2b80faf96707907cd08562d83f1216.zip |
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
Diffstat (limited to 'common/rdr/TLSInStream.cxx')
-rw-r--r-- | common/rdr/TLSInStream.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
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 <rdr/Exception.h> #include <rdr/TLSException.h> #include <rdr/TLSInStream.h> +#include <rdr/TLSErrno.h> #include <errno.h> -#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; } |