From: hadaq <hadaq>
Date: Thu, 5 Jul 2007 15:56:58 +0000 (+0000)
Subject: In function openUdp retVal got some positive initialization otherwise it can get... 
X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5d9d53abd84e27fe61a5598153cc082d61b96f47;p=daqdata.git

In function openUdp retVal got some positive initialization otherwise it can get a random negative number and cause an error! S.Y.
---

diff --git a/hadaq/nettrans.c b/hadaq/nettrans.c
index 1f5159a..8fb9096 100644
--- a/hadaq/nettrans.c
+++ b/hadaq/nettrans.c
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/nettrans.c,v 6.38 2005-05-02 13:58:36 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/nettrans.c,v 6.39 2007-07-05 15:56:58 hadaq Exp $";
 
 
 #define _GNU_SOURCE
@@ -31,7 +31,10 @@ static int min(int a, int b)
 
 static int openUdp(NetTrans *my, unsigned long addr, int port, int fl)
 {
-	int retVal;
+/*      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;
 
 	assert(my != NULL);
 
@@ -67,11 +70,13 @@ static int openUdp(NetTrans *my, unsigned long addr, int port, int fl)
 	} else {
 		retVal = -1;
 	}
+
 	my->mtuSize = 15 * 1024;
 
 	if (0 > retVal) {
 		syslog(LOG_DEBUG, "openUdp: %s", strerror(errno));
 	}
+
 	return retVal;
 }