From: Wilfried Göesgens Date: Sun, 7 Jun 2009 14:17:22 +0000 (+0000) Subject: * if we split these function calls, webcit will work in valgrind with gdb attaching. X-Git-Tag: v7.86~1097 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=53b0c0c8794b64528d7384bf3500a5367a03d358 * if we split these function calls, webcit will work in valgrind with gdb attaching. --- diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 00f7a273c..53ff1ebce 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -398,6 +398,7 @@ int ClientGetLine(ParsedHttpHdrs *Hdr, StrBuf *Target) */ int ig_tcp_server(char *ip_addr, int port_number, int queue_len) { + struct protoent *p; struct sockaddr_in sin; int s, i; @@ -419,7 +420,9 @@ int ig_tcp_server(char *ip_addr, int port_number, int queue_len) } sin.sin_port = htons((u_short) port_number); - s = socket(PF_INET, SOCK_STREAM, (getprotobyname("tcp")->p_proto)); + p = getprotobyname("tcp"); + + s = socket(PF_INET, SOCK_STREAM, (p->p_proto)); if (s < 0) { lprintf(1, "Can't create a socket: %s\n", strerror(errno)); exit(WC_EXIT_BIND);