From 7b02a5e9bdee5304fa1fef9cb73ce576335834e6 Mon Sep 17 00:00:00 2001 From: Jiri Bohac Date: Wed, 15 May 2013 17:24:30 +0200 Subject: [PATCH] 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 --- sk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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");