From 330f54ac7f780872223f9cac62347393ffb4ef86 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 6 Jul 2017 21:42:01 +0000 Subject: Initial commit --- src/libwpactrl/wpactrl_querysa.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/libwpactrl/wpactrl_querysa.c (limited to 'src/libwpactrl/wpactrl_querysa.c') diff --git a/src/libwpactrl/wpactrl_querysa.c b/src/libwpactrl/wpactrl_querysa.c new file mode 100644 index 0000000..fe06202 --- /dev/null +++ b/src/libwpactrl/wpactrl_querysa.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include +#include +#include +#include "wpactrl-internal.h" + +int wpactrl_querysa (wpactrl_t *a, char const *s, size_t len, stralloc *sa, tain_t const *deadline, tain_t *stamp) +{ + char buf[WPACTRL_PACKET_MAX] ; + ssize_t r = wpactrl_query(a, s, len, buf, WPACTRL_PACKET_MAX, deadline, stamp) ; + if (r < 0) return 0 ; + if (!r) return (errno = EPIPE, 0) ; + return stralloc_catb(sa, buf, r) ; +} -- cgit v1.2.3