diff -ruN fbbsrc.704r11/src/drv_sock.c fbbsrc.704r11cathryn/src/drv_sock.c --- fbbsrc.704r11/src/drv_sock.c 2010-06-22 13:03:01.000000000 -0700 +++ fbbsrc.704r11cathryn/src/drv_sock.c 2010-11-13 22:43:56.284120401 -0800 @@ -74,7 +74,8 @@ #define RETR_EVENT 3 #define BUSY_EVENT 4 -#define SOCK_MAXCAN 50 +#define SOCK_MAXCAN (MAXVOIES) /* was 50 -- this was causing bad problems. + This table was being accessed beyond the array */ #define CAN_AX25 0 #define CAN_NETROM 1 @@ -104,7 +105,7 @@ } scan_t; -scan_t scan[SOCK_MAXCAN]; +scan_t scan[SOCK_MAXCAN] = {{0}}; /* I think this is necessary (Though not 100% sure. */ static int last_can = 1; static int msocket = -1; @@ -692,8 +693,11 @@ static int stop_cnx (int port) { - close(p_port[port].fd); - p_port[port].fd = 0; + if (p_port[port].fd) /* Prevent closing of 0 */ + { + close(p_port[port].fd); + p_port[port].fd = 0; + } return 1; } diff -ruN fbbsrc.704r11/src/drv_tcp.c fbbsrc.704r11cathryn/src/drv_tcp.c --- fbbsrc.704r11/src/drv_tcp.c 2009-11-27 08:50:44.000000000 -0800 +++ fbbsrc.704r11cathryn/src/drv_tcp.c 2010-11-13 16:55:53.363119445 -0800 @@ -950,8 +950,11 @@ static int stop_cnx (int port) { - close(p_port[port].fd); - p_port[port].fd = 0; + if (p_port[port].fd) /* Prevent closing of 0 */ + { + close(p_port[port].fd); + p_port[port].fd = 0; + } return 1; } @@ -1439,7 +1442,7 @@ fd_set tcp_excep; struct timeval to; - if (can->sock == -1) + if (can->sock <= 0) /* Was -1. Sock=0 during housekeeping. Cause of select errors */ return (0); if ((can->timeout) && (can->timeout < time (NULL))) diff -ruN fbbsrc.704r11/src/xfbbd.c fbbsrc.704r11cathryn/src/xfbbd.c --- fbbsrc.704r11/src/xfbbd.c 2009-11-27 08:50:44.000000000 -0800 +++ fbbsrc.704r11cathryn/src/xfbbd.c 2010-11-13 17:10:40.879123108 -0800 @@ -195,7 +195,10 @@ { if (i == SIGBUS || i == SIGSEGV || i == SIGALRM) continue; - signal (i, sig_fct); + else if (i == SIGHUP || i == SIGTERM || i == SIGBUS || i == SIGSEGV) + signal (i, sig_fct); /* Use sig_fct only for signals that do something */ + else + signal (i, SIG_IGN); /* Otherwise ignore */ } for (ng = 1; ng < ac; ng++)