mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix: compilation on some os
This commit is contained in:
parent
31f63398dc
commit
e12766a656
@ -368,7 +368,12 @@ int waybar::modules::Network::netlinkRequest(void *req, uint32_t reqlen, uint32_
|
||||
sa.nl_family = AF_NETLINK;
|
||||
sa.nl_groups = groups;
|
||||
struct iovec iov = {req, reqlen};
|
||||
struct msghdr msg = {&sa, sizeof(sa), &iov, 1, nullptr, 0, 0};
|
||||
struct msghdr msg = {
|
||||
.msg_name = &sa,
|
||||
.msg_namelen = sizeof(sa),
|
||||
.msg_iov = &iov,
|
||||
.msg_iovlen = 1,
|
||||
};
|
||||
return sendmsg(nl_socket_get_fd(ev_sock_), &msg, 0);
|
||||
}
|
||||
|
||||
@ -377,8 +382,13 @@ int waybar::modules::Network::netlinkResponse(void *resp, uint32_t resplen, uint
|
||||
sa.nl_family = AF_NETLINK;
|
||||
sa.nl_groups = groups;
|
||||
struct iovec iov = {resp, resplen};
|
||||
struct msghdr msg = {&sa, sizeof(sa), &iov, 1, nullptr, 0, 0};
|
||||
auto ret = recvmsg(nl_socket_get_fd(ev_sock_), &msg, 0);
|
||||
struct msghdr msg = {
|
||||
.msg_name = &sa,
|
||||
.msg_namelen = sizeof(sa),
|
||||
.msg_iov = &iov,
|
||||
.msg_iovlen = 1,
|
||||
};
|
||||
auto ret = recvmsg(nl_socket_get_fd(ev_sock_), &msg, 0);
|
||||
if (msg.msg_flags & MSG_TRUNC) {
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user