diff options
Diffstat (limited to 'src/shared/socket-util.c')
-rw-r--r-- | src/shared/socket-util.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c index 954686f974..1175795d7c 100644 --- a/src/shared/socket-util.c +++ b/src/shared/socket-util.c @@ -568,45 +568,6 @@ bool socket_address_matches_fd(const SocketAddress *a, int fd) { return false; } -int make_socket_fd(const char* address, int flags) { - SocketAddress a; - int fd, r; - _cleanup_free_ char *p = NULL; - - r = socket_address_parse(&a, address); - if (r < 0) { - log_error("failed to parse socket: %s", strerror(-r)); - return r; - } - - fd = socket(socket_address_family(&a), flags, 0); - if (fd < 0) { - log_error("socket(): %m"); - return -errno; - } - - r = socket_address_print(&a, &p); - if (r < 0) { - log_error("socket_address_print(): %s", strerror(-r)); - return r; - } - log_info("Listening on %s", p); - - r = bind(fd, &a.sockaddr.sa, a.size); - if (r < 0) { - log_error("bind to %s: %m", address); - return -errno; - } - - r = listen(fd, SOMAXCONN); - if (r < 0) { - log_error("listen on %s: %m", address); - return -errno; - } - - return fd; -} - static const char* const netlink_family_table[] = { [NETLINK_ROUTE] = "route", [NETLINK_FIREWALL] = "firewall", |