From: <sar...@us...> - 2009-09-15 15:15:04
|
Update of /cvsroot/ceps/sddb/sddbd In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19674 Modified Files: Tag: RHEL5U8_Migration sddbd.c Log Message: 1. Given the hack to GCC Compiler 4.3, where it puts the variable in BSS instead of data segment, where global/static global variable which are initialized to 0. But, this causes the issue while incrementing the variable. Hence, initialized to -1 and reset to 0 in main program just it starts its actual flow. Index: sddbd.c =================================================================== RCS file: /cvsroot/ceps/sddb/sddbd/sddbd.c,v retrieving revision 2.72 retrieving revision 2.72.2.1 diff -C2 -d -r2.72 -r2.72.2.1 *** sddbd.c 12 Apr 2005 23:19:12 -0000 2.72 --- sddbd.c 15 Sep 2009 15:14:51 -0000 2.72.2.1 *************** *** 123,127 **** unsigned long tseqno=-1; static char *progname; ! static int pktcount=0; /* Packet counter */ static int pktrate=0; /* Last packet rate recorded */ static time_t timestart; --- 123,127 ---- unsigned long tseqno=-1; static char *progname; ! static int pktcount=-1; /* Packet counter */ /* Did hack to compiler bug :) */ static int pktrate=0; /* Last packet rate recorded */ static time_t timestart; *************** *** 403,406 **** --- 403,411 ---- struct protoent *udp_protoent; + // Given the hack to GCC 4.3 compiler to store the static variable in data segment + // to avoid the corruption. The increment value reaches to Max value, if it is bss + // variable... ugly way to do this... sucks. + pktcount = 0; + /* Record when we started */ *************** *** 4257,4260 **** --- 4262,4272 ---- /* * $Log$ + * Revision 2.72.2.1 2009/09/15 15:14:51 saravanc + * 1. Given the hack to GCC Compiler 4.3, where it puts the variable in + * BSS instead of data segment, where global/static global variable + * which are initialized to 0. But, this causes the issue while incrementing + * the variable. Hence, initialized to -1 and reset to 0 in main program just + * it starts its actual flow. + * * Revision 2.72 2005/04/12 23:19:12 damo * Changed the recvfrom and sendto into non-blocking versions. There seems |