aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makemodule.am2
-rw-r--r--lib/include/initsock.h6
-rw-r--r--lib/init/free_init_status.c10
-rw-r--r--lib/init/init_socket_recv_status.c2
4 files changed, 16 insertions, 4 deletions
diff --git a/lib/Makemodule.am b/lib/Makemodule.am
index a131463..8dcff06 100644
--- a/lib/Makemodule.am
+++ b/lib/Makemodule.am
@@ -1,7 +1,7 @@
libinit_a_SOURCES = lib/init/delsvc.c lib/init/svcmap.c lib/init/rdsvc.c
libinit_a_SOURCES += lib/init/svcscan.c lib/init/del_svc_list.c
libinit_a_SOURCES += lib/init/svc_tsort.c lib/include/service.h
-libinit_a_SOURCES += lib/init/init_socket_open.c
+libinit_a_SOURCES += lib/init/init_socket_open.c lib/init/free_init_status.c
libinit_a_SOURCES += lib/include/initsock.h lib/init/init_socket_send_request.c
libinit_a_SOURCES += lib/init/init_socket_recv_status.c
libinit_a_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/lib/include/initsock.h b/lib/include/initsock.h
index afbf861..04b8ffd 100644
--- a/lib/include/initsock.h
+++ b/lib/include/initsock.h
@@ -45,12 +45,14 @@ typedef struct {
int id;
char *filename;
char *service_name;
-} init_status_response_t;
+} init_status_t;
int init_socket_open(const char *tmppath);
int init_socket_send_request(int fd, E_INIT_REQUEST rq, ...);
-int init_socket_recv_status(int fd, init_status_response_t *resp);
+int init_socket_recv_status(int fd, init_status_t *resp);
+
+void free_init_status(init_status_t *resp);
#endif /* INITSOCK_H */
diff --git a/lib/init/free_init_status.c b/lib/init/free_init_status.c
new file mode 100644
index 0000000..945d407
--- /dev/null
+++ b/lib/init/free_init_status.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: ISC */
+#include <stdlib.h>
+
+#include "initsock.h"
+
+void free_init_status(init_status_t *resp)
+{
+ free(resp->filename);
+ free(resp->service_name);
+}
diff --git a/lib/init/init_socket_recv_status.c b/lib/init/init_socket_recv_status.c
index b812819..d5ca2e6 100644
--- a/lib/init/init_socket_recv_status.c
+++ b/lib/init/init_socket_recv_status.c
@@ -61,7 +61,7 @@ static char *read_string(int fd)
return buffer;
}
-int init_socket_recv_status(int fd, init_status_response_t *resp)
+int init_socket_recv_status(int fd, init_status_t *resp)
{
uint8_t info[8];