[Quickfix-developers] unitialized variables leads to undifined signal handling
Brought to you by:
orenmnero
From: Clark S. <cla...@ya...> - 2005-03-03 23:51:27
|
In the original source code, sa_mask, and sa_flags are uninitialized. If you read the man page on signaction, this is a bad thing. I added two lines sigemptyset( &sa.sa_mask); sa.sa_flags = 0; to fix the situation namespace FIX { void socket_init() { QF_STACK_PUSH(socket_init) #ifdef _MSC_VER WORD version = MAKEWORD( 2, 2 ); WSADATA data; WSAStartup( version, &data ); #else struct sigaction sa; sa.sa_handler = SIG_IGN; sigemptyset( &sa.sa_mask); sa.sa_flags = 0; sigaction( SIGPIPE, &sa, 0 ); #endif QF_STACK_POP } __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ |