chiark / gitweb /
service: optionally, trie dbus name cycle to service cycle
[elogind.git] / socket-util.c
index 96567c6d81ec247e78e7303d483f166046633e05..cd5ab82a2307d756f3aa6addfbd7e7642f85e573 100644 (file)
@@ -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;
+}