消除centos7编译告警

This commit is contained in:
wangmenglan
2023-02-28 21:42:52 +08:00
parent 2b75a01146
commit 3401fcb403
2 changed files with 7 additions and 6 deletions

View File

@@ -113,12 +113,12 @@ static ssize_t bfd_vtysh_client_receive(struct bfd_vtysh_client *client, char *b
uint8_t buf[CMSG_SPACE(sizeof(int))];
struct cmsghdr align;
} u;
struct msghdr mh = {
.msg_iov = iov,
.msg_iovlen = 1,
.msg_control = u.buf,
.msg_controllen = sizeof(u.buf),
};
struct msghdr mh;
memset(&mh, 0, sizeof(mh));
mh.msg_iov = iov;
mh.msg_iovlen = 1;
mh.msg_control = u.buf;
mh.msg_controllen = sizeof(u.buf);
struct cmsghdr *cmh = CMSG_FIRSTHDR(&mh);
ssize_t ret;