diff options
Diffstat (limited to 'unix/tclUnixChan.c')
-rw-r--r-- | unix/tclUnixChan.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 5609a15..3b0d984 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.106 2010/06/21 11:23:23 nijtmans Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.107 2010/09/28 15:13:55 rmax Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -1681,8 +1681,9 @@ Tcl_MakeFileChannel( sprintf(channelName, "serial%d", fd); } else #endif /* SUPPORTS_TTY */ - if ((getsockname(fd, &sockaddr, &sockaddrLen) == 0) - && (sockaddrLen > 0) && (sockaddr.sa_family == AF_INET)) { + if ((getsockname(fd, (struct sockaddr *)&sockaddr, &sockaddrLen) == 0) + && (sockaddrLen > 0) + && (sockaddr.sa_family == AF_INET || sockaddr.sa_family == AF_INET6)) { return TclpMakeTcpClientChannelMode(INT2PTR(fd), mode); } else { channelTypePtr = &fileChannelType; |