summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-05-07 12:33:18 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-05-07 12:33:18 +0200
commit442dad3521cfb2e4b1f352583db13caf8bd1f128 (patch)
tree1075e5f85a365e5698748e072daf6f6db7e2c6f2
parent773ec2bb0a7fcb5cfead5e762896c6179eb63388 (diff)
downloadrsyslog-442dad3521cfb2e4b1f352583db13caf8bd1f128.tar.gz
rsyslog-442dad3521cfb2e4b1f352583db13caf8bd1f128.tar.xz
rsyslog-442dad3521cfb2e4b1f352583db13caf8bd1f128.zip
limited number of unavoidable compiler warnings when compiling with GnuTLS
-rw-r--r--ChangeLog3
-rw-r--r--runtime/nsd_gtls.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8649b39c..e00c5657 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ Version 3.19.1 (rgerhards), 2008-05-07
- configure help for --enable-gnutls wrong - said default is "yes" but
default actually is "no" - thanks to darix for pointing this out
- file dirty.h was missing - thanks to darix for pointing this out
+- bugfix: man files were not properly distributed - thanks to
+ darix for reporting and to Michael Biebl for help with the fix
+- some minor cleanup
---------------------------------------------------------------------------
Version 3.19.0 (rgerhards), 2008-05-06
- begins new devel branch version
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index fd709fe3..a346118b 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -221,6 +221,19 @@ gtlsEndSess(nsd_gtls_t *pThis)
}
+/* a small wrapper for gnutls_transport_set_ptr(). The main intension for
+ * creating this wrapper is to get the annoying "cast to pointer from different
+ * size" compiler warning just once. There seems to be no way around it, see:
+ * http://lists.gnu.org/archive/html/help-gnutls/2008-05/msg00000.html
+ * rgerhards, 2008.05-07
+ */
+static inline void
+gtlsSetTransportPtr(nsd_gtls_t *pThis, int sock)
+{
+ /* Note: the compiler warning for the next line is OK - see header comment! */
+ gnutls_transport_set_ptr(pThis->sess, (gnutls_transport_ptr_t) sock);
+}
+
/* ---------------------------- end GnuTLS specifics ---------------------------- */
@@ -378,7 +391,7 @@ AcceptConnReq(nsd_t *pNsd, nsd_t **ppNew)
/* if we reach this point, we are in TLS mode */
CHKiRet(gtlsInitSession(pNew));
- gnutls_transport_set_ptr(pNew->sess, (gnutls_transport_ptr_t)((nsd_ptcp_t*) (pNew->pTcp))->sock);
+ gtlsSetTransportPtr(pNew, ((nsd_ptcp_t*) (pNew->pTcp))->sock);
/* we now do the handshake. This is a bit complicated, because we are
* on non-blocking sockets. Usually, the handshake will not complete
@@ -509,7 +522,7 @@ Connect(nsd_t *pNsd, int family, uchar *port, uchar *host)
/* assign the socket to GnuTls */
CHKiRet(nsd_ptcp.GetSock(pThis->pTcp, &sock));
- gnutls_transport_set_ptr(pThis->sess, (gnutls_transport_ptr_t)sock);
+ gtlsSetTransportPtr(pThis, sock);
/* and perform the handshake */
CHKgnutls(gnutls_handshake(pThis->sess));