chiark / gitweb /
core: add valgrind helper for daemon-reexec
[elogind.git] / src / basic / socket-util.c
index b2aee389442b7e63b1c95c5d9b52635cb9f1f583..ee08a9c9c89ec2ad03de26438f9956ddb7ce29b5 100644 (file)
 #include "fd-util.h"
 #include "fileio.h"
 #include "formats-util.h"
+#include "log.h"
 #include "macro.h"
 #include "missing.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "socket-util.h"
-#include "log.h"
 #include "string-table.h"
 #include "string-util.h"
 #include "user-util.h"
@@ -876,16 +876,24 @@ int getpeersec(int fd, char **ret) {
         return 0;
 }
 
-int send_one_fd(int transport_fd, int fd, int flags) {
+int send_one_fd_sa(
+                int transport_fd,
+                int fd,
+                const struct sockaddr *sa, socklen_t len,
+                int flags) {
+
         union {
                 struct cmsghdr cmsghdr;
                 uint8_t buf[CMSG_SPACE(sizeof(int))];
         } control = {};
+        struct cmsghdr *cmsg;
+
         struct msghdr mh = {
+                .msg_name = (struct sockaddr*) sa,
+                .msg_namelen = len,
                 .msg_control = &control,
                 .msg_controllen = sizeof(control),
         };
-        struct cmsghdr *cmsg;
 
         assert(transport_fd >= 0);
         assert(fd >= 0);