diff options
Diffstat (limited to 'socket-util.c')
-rw-r--r-- | socket-util.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/socket-util.c b/socket-util.c index 96567c6d81..cd5ab82a23 100644 --- a/socket-util.c +++ b/socket-util.c @@ -316,7 +316,7 @@ int socket_address_listen( if ((r = socket_address_verify(a)) < 0) return r; - if ((fd = socket(socket_address_family(a), a->type | SOCK_NONBLOCK | SOCK_CLOEXEC, 0)) < 0) + if ((fd = socket(socket_address_family(a), a->type | SOCK_NONBLOCK, 0)) < 0) return -errno; if (socket_address_family(a) == AF_INET6 && only != SOCKET_ADDRESS_DEFAULT) { @@ -373,3 +373,11 @@ fail: close_nointr(fd); return r; } + +bool socket_address_can_accept(const SocketAddress *a) { + assert(a); + + return + a->type == SOCK_STREAM || + a->type == SOCK_SEQPACKET; +} |