Improve error reporting on receive path.

In some error cases, no message is logged. Now we always complain loudly
when an error occurs.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-03-18 08:36:38 +01:00
parent 9d4d68e667
commit aa142c5240
1 changed files with 7 additions and 4 deletions

11
sk.c
View File

@ -138,14 +138,17 @@ int sk_receive(int fd, void *buf, int buflen,
} else if (errno == EAGAIN) {
usleep(1);
} else {
if (flags == MSG_ERRQUEUE)
pr_err("recvmsg tx timestamp failed: %m");
else
pr_err("recvmsg failed: %m");
break;
}
}
if (cnt < 1) {
if (flags == MSG_ERRQUEUE)
pr_err("recvmsg tx timestamp failed: %m");
else
pr_err("recvmsg failed: %m");
}
for (cm = CMSG_FIRSTHDR(&msg); cm != NULL; cm = CMSG_NXTHDR(&msg, cm)) {
level = cm->cmsg_level;
type = cm->cmsg_type;