-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/nettrans.c,v 6.40 2008-03-31 17:45:21 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/nettrans.c,v 6.41 2008-06-24 18:05:09 hadaq Exp $";
#define _GNU_SOURCE
/* retVal needs some positive initialization otherwise */
/* it can get a random negative number and cause an error! */
/* S.Y. 05.07.2007 */
- int retVal = 1363391884;
+ int retVal = 1;
assert(my != NULL);
} else if (fl == O_RDONLY) {
int rcvBufLenReq = 1 * (1 << 20);
int rcvBufLenRet;
- int rcvBufLenLen = sizeof(rcvBufLenReq);
+ size_t rcvBufLenLen = (size_t) sizeof(rcvBufLenReq);
if (setsockopt(my->fd, SOL_SOCKET, SO_RCVBUF, &rcvBufLenReq, rcvBufLenLen) == -1) {
syslog(LOG_WARNING, "setsockopt(..., SO_RCVBUF, ...): %s", strerror(errno));
}
- if (getsockopt(my->fd, SOL_SOCKET, SO_RCVBUF, &rcvBufLenRet, &rcvBufLenLen) == -1) {
+ if (getsockopt(my->fd, SOL_SOCKET, SO_RCVBUF, &rcvBufLenRet, (socklen_t *)&rcvBufLenLen) == -1) {
syslog(LOG_WARNING, "getsockopt(..., SO_RCVBUF, ...): %s", strerror(errno));
}
if (rcvBufLenRet < rcvBufLenReq) {
int recvGeneric(NetTrans *my)
{
int retVal;
- int socklen = sizeof(my->spec.sa);
+ size_t socklen = (size_t) sizeof(my->spec.sa);
assert(NetTrans_invariant(my));
switch (my->type) {
case NetTransType_udp:
- retVal = recvfrom(my->fd, my->pkt, my->mtuSize, 0, &my->spec.sa, &socklen);
+ retVal = recvfrom(my->fd, my->pkt, my->mtuSize, 0, &my->spec.sa, (socklen_t *)&socklen);
break;
}