fix misleading pr_err on poll timeout

If poll() times out, don't print a misleading errno, say that a timeout
occured.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
master
Jiri Bohac 2013-05-15 17:24:30 +02:00 committed by Richard Cochran
parent 9c83fcb3c9
commit 7b02a5e9bd
1 changed files with 2 additions and 1 deletions

3
sk.c
View File

@ -218,7 +218,8 @@ int sk_receive(int fd, void *buf, int buflen,
struct pollfd pfd = { fd, 0, 0 }; struct pollfd pfd = { fd, 0, 0 };
res = poll(&pfd, 1, sk_tx_timeout); res = poll(&pfd, 1, sk_tx_timeout);
if (res < 1) { if (res < 1) {
pr_err("poll tx timestamp failed: %m"); pr_err(res ? "poll tx timestamp failed: %m" :
"poll tx timestamp timeout");
return res; return res;
} else if (!(pfd.revents & POLLERR)) { } else if (!(pfd.revents & POLLERR)) {
pr_err("poll tx woke up on non ERR event"); pr_err("poll tx woke up on non ERR event");