Discussion:
[Linuxptp-devel] [PATCH] fix misleading pr_err on poll timeout
Jiri Bohac
2013-05-15 15:24:30 UTC
Permalink
If poll() times out, don't print a misleading errno, say that a timeout
occured.

Signed-off-by: Jiri Bohac <***@suse.cz>

diff --git a/sk.c b/sk.c
index 1ff5325..0437ad8 100644
--- a/sk.c
+++ b/sk.c
@@ -218,7 +218,8 @@ int sk_receive(int fd, void *buf, int buflen,
struct pollfd pfd = { fd, 0, 0 };
res = poll(&pfd, 1, sk_tx_timeout);
if (res < 1) {
- pr_err("poll tx timestamp failed: %m");
+ pr_err(res ? "poll tx timestamp failed: %m" :
+ "poll tx timestamp timeout");
return res;
} else if (!(pfd.revents & POLLERR)) {
pr_err("poll tx woke up on non ERR event");
--
Jiri Bohac <***@suse.cz>
SUSE Labs, SUSE CZ
Richard Cochran
2013-05-16 12:38:46 UTC
Permalink
Post by Jiri Bohac
If poll() times out, don't print a misleading errno, say that a timeout
occured.
Applied.

Thanks,
Richard

Loading...