diff options
Diffstat (limited to 'ext/socket/ipsocket.c')
-rw-r--r-- | ext/socket/ipsocket.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c index 447ae40db6..b6b2426e97 100644 --- a/ext/socket/ipsocket.c +++ b/ext/socket/ipsocket.c @@ -104,8 +104,13 @@ init_inetsock_internal(struct inetsock_arg *arg) arg->fd = -1; - if (type == INET_SERVER) - listen(fd, 5); + if (type == INET_SERVER) { + status = listen(fd, 5); + if (status < 0) { + close(fd); + syscall = "listen(2)"; + } + } /* create new instance */ return rsock_init_sock(arg->sock, fd); |