aboutsummaryrefslogtreecommitdiff
path: root/lib/init
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2019-03-27 17:48:13 +0100
committerDavid Oberhollenzer <goliath@infraroot.at>2019-03-27 17:48:32 +0100
commitd16d26018126d381954110e8cdb788650eb41d9e (patch)
treed398bc1c0dbbde87d22f0eb686e4bf6f90056e73 /lib/init
parentaffe9e4b8802ccb2d9749300327969dcf4222bc1 (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.c14
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));