aboutsummaryrefslogtreecommitdiff
path: root/lib/init
diff options
context:
space:
mode:
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));