diff options
Diffstat (limited to 'src/libs6/s6_fdholder_start.c')
-rw-r--r-- | src/libs6/s6_fdholder_start.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libs6/s6_fdholder_start.c b/src/libs6/s6_fdholder_start.c new file mode 100644 index 0000000..d887247 --- /dev/null +++ b/src/libs6/s6_fdholder_start.c @@ -0,0 +1,19 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/webipc.h> +#include <skalibs/unixconnection.h> +#include <s6/s6-fdholder.h> + +int s6_fdholder_start (s6_fdholder_t *a, char const *path, tain_t const *deadline, tain_t *stamp) +{ + int fd = ipc_stream_nb() ; + if (fd < 0) return 0 ; + if (!ipc_timed_connect(fd, path, deadline, stamp)) + { + fd_close(fd) ; + return 0 ; + } + unixconnection_init(&a->connection, fd, fd) ; + return 1 ; +} |