int sock;
sock = socket(PF_NETLINK, SOCK_RAW, protocol);
if (sock < 0)
- return -EINVAL;
+ return -EINVAL; //LCOV_EXCL_LINE
struct sockaddr_nl src_addr = { 0, };
src_addr.nl_groups = groups;
if (bind(sock, (struct sockaddr *)&src_addr, sizeof(src_addr)) < 0) {
- close(sock);
- return -1;
+ close(sock); //LCOV_EXCL_LINE
+ return -1; //LCOV_EXCL_LINE
}
return sock;
};
ret = recvmsg(sock, &msg, 0);
if (ret == -1)
- return ret;
+ return ret; //LCOV_EXCL_LINE
if (msg.msg_flags & MSG_TRUNC) {
- errno = ENOSPC;
- return -1;
+ errno = ENOSPC; //LCOV_EXCL_LINE
+ return -1; //LCOV_EXCL_LINE
}
if (msg.msg_namelen != sizeof(struct sockaddr_nl)) {
- errno = EINVAL;
- return -1;
+ errno = EINVAL; //LCOV_EXCL_LINE
+ return -1; //LCOV_EXCL_LINE
}
return ret;