journal: unbreak sd_journal_sendv

Borked since
commit 3ee897d6c2
Author: Lennart Poettering <lennart@poettering.net>
Date:   Wed Sep 23 01:00:04 2015 +0200

    tree-wide: port more code to use send_one_fd() and receive_one_fd()

because here our fd is not connected and we need to specify
the address.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2015-12-03 09:14:01 -05:00
parent 85049096c7
commit 726f4c4738
3 changed files with 16 additions and 4 deletions
+10 -2
View File
@@ -870,16 +870,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);