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
diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx
index e553085..4d2c9ec 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 @@
 
   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 @@
     in->readBytes(data, size);
 
   } catch (Exception& e) {
-    gnutls_transport_set_global_errno(EINVAL);
+    gnutls_errno_helper(self->session, EINVAL);
     return -1;
   }