]> gitweb.factorcode.org Git - factor.git/commitdiff
io.sockets: change protocol-port to handle ``f`` on all platforms.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 12 Mar 2014 14:24:40 +0000 (07:24 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 12 Mar 2014 14:27:39 +0000 (07:27 -0700)
basis/io/sockets/sockets-tests.factor
basis/io/sockets/sockets.factor

index 64b6d88a63de1d4e1c4258986a8c2f2663db6d1c..7adcc93cb64a00f4e3963f0ebf8765ad96b06991 100644 (file)
@@ -171,3 +171,4 @@ os unix? [
 [ ] [ f 0 <inet6> <datagram> dispose ] unit-test
 
 [ 80 ] [ "http" protocol-port ] unit-test
+[ f ] [ f protocol-port ] unit-test
index 8afb4388e4c25042e62a626b9bd001c92721e2ac..4e5c3a72a4901871ff485896f81edc5182d008a5 100644 (file)
@@ -465,7 +465,7 @@ M: invalid-local-address summary
     ] dip with-variable ; inline
 
 : protocol-port ( protocol -- port )
-    f getservbyname [ port>> htons ] [ f ] if* ;
+    [ f getservbyname [ port>> htons ] [ f ] if* ] [ f ] if* ;
 
 {
     { [ os unix? ] [ "io.sockets.unix" require ] }