summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixChan.c
diff options
context:
space:
mode:
authorrmax <rmax>2010-09-28 15:13:54 (GMT)
committerrmax <rmax>2010-09-28 15:13:54 (GMT)
commit8de390107eb243b132d238c82d5dad142732ea6f (patch)
tree3c49ea8f056c9653ddd2cfed43ac4615cba322bb /unix/tclUnixChan.c
parent76ae3756ac54d0957e5d6c430aec55b52ccc0bf3 (diff)
downloadtcl-8de390107eb243b132d238c82d5dad142732ea6f.zip
tcl-8de390107eb243b132d238c82d5dad142732ea6f.tar.gz
tcl-8de390107eb243b132d238c82d5dad142732ea6f.tar.bz2
* doc/socket.n: Document the changes to the [socket] and
[fconfiguyre] commands. * generic/tclInt.h: Introduce TclCreateSocketAddress() as a * generic/tclIOSock.c: replacement for the platform-dependent * unix/tclUnixSock.c: TclpCreateSocketAddress() functions. * unix/tclUnixChan.c: Extend the [socket] and [fconfigure] * unix/tclUnixPort.h: commands to behave as proposed in * win/tclWinSock.c: TIP #162. * win/tclWinPort.h: * compat/fake-rfc2553.c: A compat implementation of the APIs * compat/fake-rfc2553.h: defined in RFC-2553 (getaddrinfo() and friends) on top of the existing gethostbyname() etc. * unix/configure.in: Test whether the fake-implementation is * unix/tcl.m4: needed. * unix/Makefile.in: Add a compile target for fake-rfc2553. * win/configure.in: Allow cross-compilation by default * tests/socket.test: Improve the test suite to make more use of * tests/remote.tcl: randomized ports to reduce interference with tests running in parallel or other services on the machine.
Diffstat (limited to 'unix/tclUnixChan.c')
-rw-r--r--unix/tclUnixChan.c7
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;