From 7cfe6e845878d67f578fa846e784c064a178d9c5 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 28 Mar 2019 16:33:01 +0100 Subject: cleanup: move init specific stuff of init socket to initd Signed-off-by: David Oberhollenzer --- lib/init/init_socket_create.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 lib/init/init_socket_create.c (limited to 'lib/init/init_socket_create.c') diff --git a/lib/init/init_socket_create.c b/lib/init/init_socket_create.c deleted file mode 100644 index 82a528c..0000000 --- a/lib/init/init_socket_create.c +++ /dev/null @@ -1,35 +0,0 @@ -/* SPDX-License-Identifier: ISC */ -#include -#include -#include -#include -#include - -#include "initsock.h" - -int init_socket_create(void) -{ - struct sockaddr_un un; - int fd; - - fd = socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0); - if (fd < 0) { - perror("socket"); - return -1; - } - - memset(&un, 0, sizeof(un)); - un.sun_family = AF_UNIX; - - strcpy(un.sun_path, INIT_SOCK_PATH); - unlink(INIT_SOCK_PATH); - - if (bind(fd, (struct sockaddr *)&un, sizeof(un))) { - perror("bind: " INIT_SOCK_PATH); - close(fd); - unlink(INIT_SOCK_PATH); - return -1; - } - - return fd; -} -- cgit v1.2.3