Jiri Bohac
2013-05-15 15:24:30 UTC
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");
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
Jiri Bohac <***@suse.cz>
SUSE Labs, SUSE CZ