summaryrefslogtreecommitdiff
path: root/lib/std/listen+posixy.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/listen+posixy.myr')
-rw-r--r--lib/std/listen+posixy.myr6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/std/listen+posixy.myr b/lib/std/listen+posixy.myr
index e8018e9..1a792aa 100644
--- a/lib/std/listen+posixy.myr
+++ b/lib/std/listen+posixy.myr
@@ -91,8 +91,10 @@ const announcesock = {proto, str
if sys.bind(sock, sa, sz) < 0
-> `Err "failed to bind socket"
;;
- if sys.listen((sock : sys.fd), 10) < 0
- -> `Err "unable to listen on socket"
+ if proto == sys.Sockstream
+ if sys.listen((sock : sys.fd), 10) < 0
+ -> `Err "unable to listen on socket"
+ ;;
;;
-> `Ok mk([.lfd=(sock : fd)])
}