summaryrefslogtreecommitdiff
path: root/src/lib/s6_linux_init_logouthook.c
blob: cc6b11a4a9150800d366df23b3e2f5919bbf0b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* ISC license. */

#include <skalibs/djbunix.h>
#include <skalibs/socket.h>

#include <s6-linux-init/s6-linux-init.h>
#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 ;
}