diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-19 16:11:24 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-19 16:11:24 +0000 |
commit | 701540827e27a4f07ac725db3ce361d3be0c106f (patch) | |
tree | 98c4b2fb8ba8f69ef791feebdcd61cd5bca34140 /src/libs6/s6_fdholder_list.c | |
parent | 83853a80eb18238796154164f9ea776b0c167ab7 (diff) | |
download | s6-701540827e27a4f07ac725db3ce361d3be0c106f.tar.xz |
- added the s6_fdholder library to libs6. (Nothing useful yet.)
- fixed execline invocation in s6-log with slashpackage
- integrated s6_svc_main.c's functionality into s6-svscanctl and deleted it
- integrated Olivier Brunel's suggestions for wstat report in supervise/status
- minor fixes to s6-supervise's status reports
- separated sigaction calls in ftrigw_notifyb, this spares a few syscalls in s6-supervise
- updated doc to reflect the changes
- version bumped to 2.1.0.0 because API breakage (./finish, s6-svstat)
Diffstat (limited to 'src/libs6/s6_fdholder_list.c')
-rw-r--r-- | src/libs6/s6_fdholder_list.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libs6/s6_fdholder_list.c b/src/libs6/s6_fdholder_list.c new file mode 100644 index 0000000..4f804aa --- /dev/null +++ b/src/libs6/s6_fdholder_list.c @@ -0,0 +1,19 @@ + /* ISC license. */ + +#include <errno.h> +#include <skalibs/error.h> +#include <skalibs/tai.h> +#include <skalibs/unixmessage.h> +#include <s6/s6-fdholder.h> + +int s6_fdholder_list (s6_fdholder_t *a, stralloc *sa, tain_t const *deadline, tain_t *stamp) +{ + s6_fdholder_list_result_t res = { .sa = sa } ; + unixmessage_t m ; + if (!s6_fdholder_list_async(a)) return -1 ; + if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return -1 ; + if (!unixmessage_timed_receive(&a->connection.in, &m, deadline, stamp)) return -1 ; + if (!s6_fdholder_list_cb(&m, &res)) return -1 ; + if (res.err) return (errno = res.err, -1) ; + return (int)res.n ; +} |