File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ needs cmd socket
55needs cmd os.fork
66
77constraint eval ipv6 {[socket -ipv6 stream.server ::1:5000] close}
8+ constraint expr linux {$tcl_platform(os) eq "linux"}
89
910# Given an IPv4 or IPv6 server socket, return an address
1011# that a client can use to connect to the socket.
@@ -73,7 +74,7 @@ test socket-1.4 {unix} -body {
7374 stdout flush
7475 if {[os.fork] == 0} {
7576 # child
76- set c [socket unix [$s sockname] ]
77+ set c [socket unix $path ]
7778 $s close
7879 $c puts hello
7980 $c close
@@ -90,7 +91,7 @@ test socket-1.5 {unix.dgram} -body {
9091 set path [file tempfile]
9192 file delete $path
9293 set s [socket unix.dgram.server $path]
93- set c [socket unix.dgram [$s sockname] ]
94+ set c [socket unix.dgram $path ]
9495 $s buffering none
9596 $c buffering none
9697 $c puts -nonewline hello
@@ -204,6 +205,16 @@ test socket-1.11 {stream - ipv6 - port only} -constraints ipv6 -body {
204205 set buf
205206} -result {hello}
206207
208+ # On hurd, sockname does not return the path for unix domain sockets
209+ test socket-1.12 {unix} -constraints linux -body {
210+ set path [file tempfile]
211+ file delete $path
212+ set s [socket unix.server $path]
213+ set equal [expr {[$s sockname] eq $path}]
214+ $s close
215+ set equal
216+ } -result {1}
217+
207218test socket-2.1 {read 1} -body {
208219 lassign [socket pipe] r w
209220 $w puts -nonewline hello
You can’t perform that action at this time.
0 commit comments