diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2019-03-27 17:48:13 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2019-03-27 17:48:32 +0100 |
commit | d16d26018126d381954110e8cdb788650eb41d9e (patch) | |
tree | d398bc1c0dbbde87d22f0eb686e4bf6f90056e73 /lib/init | |
parent | affe9e4b8802ccb2d9749300327969dcf4222bc1 (diff) |
Add filter argument to status request
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'lib/init')
-rw-r--r-- | lib/init/init_socket_send_request.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/init/init_socket_send_request.c b/lib/init/init_socket_send_request.c index dd88856..e9c7cb9 100644 --- a/lib/init/init_socket_send_request.c +++ b/lib/init/init_socket_send_request.c @@ -1,19 +1,31 @@ /* SPDX-License-Identifier: ISC */ #include <unistd.h> #include <string.h> +#include <stdarg.h> #include <stdio.h> #include <errno.h> #include "initsock.h" -int init_socket_send_request(int fd, E_INIT_REQUEST rq) +int init_socket_send_request(int fd, E_INIT_REQUEST rq, ...) { init_request_t request; ssize_t ret; + va_list ap; memset(&request, 0, sizeof(request)); request.rq = rq; + va_start(ap, rq); + switch (rq) { + case EIR_STATUS: + request.arg.status.filter = va_arg(ap, E_SERVICE_STATE); + break; + default: + break; + } + va_end(ap); + retry: ret = write(fd, &request, sizeof(request)); |