summaryrefslogtreecommitdiff
path: root/src/utmps/utmps_start.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-11-20 14:51:36 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-11-20 14:51:36 +0000
commit4ba5ae5776c2e9ba4f297115c19923a928cf3e87 (patch)
tree5a67f39a64dc5df84fc20307aa95d7536890b8b5 /src/utmps/utmps_start.c
downloadutmps-4ba5ae5776c2e9ba4f297115c19923a928cf3e87.tar.xz
Initial release / rename to utmps
Diffstat (limited to 'src/utmps/utmps_start.c')
-rw-r--r--src/utmps/utmps_start.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utmps/utmps_start.c b/src/utmps/utmps_start.c
new file mode 100644
index 0000000..095fd2c
--- /dev/null
+++ b/src/utmps/utmps_start.c
@@ -0,0 +1,18 @@
+/* ISC license. */
+
+#include <skalibs/djbunix.h>
+#include <skalibs/webipc.h>
+#include <utmps/utmps.h>
+
+int utmps_start (utmps *a, char const *path, tain_t const *deadline, tain_t *stamp)
+{
+ int fd = ipc_stream_nbcoe() ;
+ if (fd < 0) return 0 ;
+ if (!ipc_timed_connect(fd, path, deadline, stamp))
+ {
+ fd_close(fd) ;
+ return 0 ;
+ }
+ a->fd = fd ;
+ return 1 ;
+}