From ba3bcbb86ea0177349bcd021559347248d6ab10a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 30 Nov 2020 13:08:04 +0000 Subject: Stash temporary changes. Does not build; is not intended to. --- src/libs6rc/s6rc_connection_start.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/libs6rc/s6rc_connection_start.c (limited to 'src/libs6rc/s6rc_connection_start.c') diff --git a/src/libs6rc/s6rc_connection_start.c b/src/libs6rc/s6rc_connection_start.c new file mode 100644 index 0000000..33b2b1a --- /dev/null +++ b/src/libs6rc/s6rc_connection_start.c @@ -0,0 +1,22 @@ +/* ISC license. */ + +#include +#include +#include + +#include +#include + +int s6rc_connection_start (s6rc_connection_t *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 ; + } + textmessage_sender_init(&a->out, fd) ; + textmessage_receiver_init(&a->in, fd, a->inbuf, S6RC_CONNECTION_BUFSIZE, TEXTMESSAGE_MAXLEN) ; + return 1 ; +} -- cgit v1.2.3