]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
audit-util,varlink: use IOVEC_MAKE() in a couple more places
authorFrantisek Sumsal <fsumsal@redhat.com>
Thu, 15 Jun 2023 18:45:32 +0000 (20:45 +0200)
committerFrantisek Sumsal <fsumsal@redhat.com>
Thu, 15 Jun 2023 18:58:24 +0000 (20:58 +0200)
src/basic/audit-util.c
src/shared/varlink.c

index f2dce206b375131f265d17be812996d69193aec9..92479affa3a775dbb16c31a80da31cccf18ff9bc 100644 (file)
@@ -10,6 +10,7 @@
 #include "audit-util.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "macro.h"
 #include "parse-util.h"
 #include "process-util.h"
@@ -85,10 +86,7 @@ static int try_audit_request(int fd) {
                 .hdr.nlmsg_type = AUDIT_GET_FEATURE,
                 .hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK,
         };
-        iov = (struct iovec) {
-                .iov_base = &msg,
-                .iov_len = msg.hdr.nlmsg_len,
-        };
+        iov = IOVEC_MAKE(&msg, msg.hdr.nlmsg_len);
         mh = (struct msghdr) {
                 .msg_iov = &iov,
                 .msg_iovlen = 1,
index 333cd3af589dc657a3df1b8555d7ea8cda001e72..343f8b4aaca9ae10c340cc734354de7bea86168e 100644 (file)
@@ -686,10 +686,7 @@ static int varlink_read(Varlink *v) {
         rs = MALLOC_SIZEOF_SAFE(v->input_buffer) - (v->input_buffer_index + v->input_buffer_size);
 
         if (v->allow_fd_passing_input) {
-                iov = (struct iovec) {
-                        .iov_base = p,
-                        .iov_len = rs,
-                };
+                iov = IOVEC_MAKE(p, rs);
                 mh = (struct msghdr) {
                         .msg_iov = &iov,
                         .msg_iovlen = 1,