summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-05-11 19:12:20 -0700
committerOri Bernstein <ori@eigenstate.org>2020-05-11 19:12:20 -0700
commit552823815f7c52c16111045b638ba8bab322e7ac (patch)
tree92466c2c0bfb0d487dab21c091f1434ab2074f28 /lib/std
parent690ab7aa8e6c56a4ae8a2bd5bce58d1df681234e (diff)
downloadmc-552823815f7c52c16111045b638ba8bab322e7ac.tar.gz
add OSX recvfrom, fix UDP announce (thanks Int21h)
system call to libsys for OS X and also made a minor edit to announcesock so it would work with UDP.
Diffstat (limited to 'lib/std')
-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)])
}