From 23fba266a9454ee6ca095b7f6eccf523f6526607 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 2 Mar 2019 09:41:24 +0000 Subject: Save pending changes in 1.0.0.0 branch --- src/lib/deps-lib/s6_linux_init | 4 ++++ src/lib/s6_linux_init_logouthook.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/lib/deps-lib/s6_linux_init create mode 100644 src/lib/s6_linux_init_logouthook.c (limited to 'src/lib') diff --git a/src/lib/deps-lib/s6_linux_init b/src/lib/deps-lib/s6_linux_init new file mode 100644 index 0000000..4c849c7 --- /dev/null +++ b/src/lib/deps-lib/s6_linux_init @@ -0,0 +1,4 @@ +s6_linux_init_logouthook.o +-lskarnet +${SOCKET_LIB} +${TAINNOW_LIB} diff --git a/src/lib/s6_linux_init_logouthook.c b/src/lib/s6_linux_init_logouthook.c new file mode 100644 index 0000000..215365d --- /dev/null +++ b/src/lib/s6_linux_init_logouthook.c @@ -0,0 +1,18 @@ +/* ISC license. */ + +#include +#include + +#include "initctl.h" + +int s6_linux_init_logouthook (void) +{ + int fd = ipc_stream_nbcoe() ; + if (fd < 0) return -1 ; + if (!ipc_timed_connect(fd, LOGOUTHOOKD_PATH, 0, 0)) + { + fd_close(fd) ; + return -1 ; + } + return fd ; +} -- cgit v1.2.3