diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-09-18 18:55:44 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-09-18 18:55:44 +0000 |
commit | 3534b428629be185e096be99e3bd5fdfe32d5544 (patch) | |
tree | 210ef3198ed66bc7f7b7bf6a85e4579f455e5a36 /src/libunixonacid/skaclient_start.c | |
download | skalibs-3534b428629be185e096be99e3bd5fdfe32d5544.tar.xz |
initial commit with rc for skalibs-2.0.0.0
Diffstat (limited to 'src/libunixonacid/skaclient_start.c')
-rw-r--r-- | src/libunixonacid/skaclient_start.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/libunixonacid/skaclient_start.c b/src/libunixonacid/skaclient_start.c new file mode 100644 index 0000000..b17750b --- /dev/null +++ b/src/libunixonacid/skaclient_start.c @@ -0,0 +1,43 @@ +/* ISC license. */ + +#include <errno.h> +#include <skalibs/kolbak.h> +#include <skalibs/skaclient.h> +#include <skalibs/tai.h> +#include "skaclient-internal.h" + +int skaclient_start ( + skaclient_t *a, + char *bufss, + unsigned int bufsn, + char *auxbufss, + unsigned int auxbufsn, + char *bufas, + unsigned int bufan, + char *auxbufas, + unsigned int auxbufan, + kolbak_closure_t *q, + unsigned int qlen, + char const *path, + char const *before, + unsigned int beforelen, + char const *after, + unsigned int afterlen, + tain_t const *deadline, + tain_t *stamp) +{ + skaclient_cbdata_t blah ; + unixmessage_t m ; + register int r ; + if (!skaclient_start_async(a, bufss, bufsn, auxbufss, auxbufsn, bufas, bufan, auxbufas, auxbufan, q, qlen, path, before, beforelen, after, afterlen, &blah)) return 0 ; + r = unixmessage_timed_receive(&a->syncin, &m, deadline, stamp) ; + if (r < 1) + { + int e = errno ; + if (!r) e = EPIPE ; + skaclient_end(a) ; + errno = e ; + return 0 ; + } + return kolbak_call(&m, &a->kq) ; +} |