diff options
author | rmax <rmax> | 2010-10-26 16:14:18 (GMT) |
---|---|---|
committer | rmax <rmax> | 2010-10-26 16:14:18 (GMT) |
commit | a6ec7c41b55d1b50133593bd6d340471a5177ae1 (patch) | |
tree | be700504e9d7a57575fa0d5a8890466d5a7df97f /generic/tclIOSock.c | |
parent | b9c2ff53ae874d4250ad4faaf68d0437cdc3d550 (diff) | |
download | tcl-a6ec7c41b55d1b50133593bd6d340471a5177ae1.zip tcl-a6ec7c41b55d1b50133593bd6d340471a5177ae1.tar.gz tcl-a6ec7c41b55d1b50133593bd6d340471a5177ae1.tar.bz2 |
* Changelog.2008: Split off from Changelog.
* generic/tclIOSock.c (TclCreateSocketAddress): The interp != NULL
check is needed for ::tcl::unsupported::socketAF as well.
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r-- | generic/tclIOSock.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index 2780462..72ad64d 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOSock.c,v 1.13 2010/10/07 23:36:27 nijtmans Exp $ + * RCS: @(#) $Id: tclIOSock.c,v 1.14 2010/10/26 16:14:19 rmax Exp $ */ #include "tclInt.h" @@ -146,7 +146,7 @@ TclCreateSocketAddress( struct addrinfo *v4head = NULL, *v4ptr = NULL; struct addrinfo *v6head = NULL, *v6ptr = NULL; char *native = NULL, portstring[TCL_INTEGER_SPACE]; - const char *family; + const char *family = NULL; Tcl_DString ds; int result, i; @@ -159,13 +159,18 @@ TclCreateSocketAddress( (void) memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; - /* Magic variable to enforce a certain address family */ - family = Tcl_GetVar(interp, "::tcl::unsupported::socketAF", 0); - if (family != NULL) { - if (strcmp(family, "inet") == 0) { - hints.ai_family = AF_INET; - } else if (strcmp(family, "inet6") == 0) { - hints.ai_family = AF_INET6; + /* + * Magic variable to enforce a certain address family - to be superseded + * by a TIP that adds explicit switches to [socket] + */ + if (interp != NULL) { + family = Tcl_GetVar(interp, "::tcl::unsupported::socketAF", 0); + if (family != NULL) { + if (strcmp(family, "inet") == 0) { + hints.ai_family = AF_INET; + } else if (strcmp(family, "inet6") == 0) { + hints.ai_family = AF_INET6; + } } } |