It is possible to read 0 bytes from timerfd descriptor
despite the fact that descriptor notified poll() that descriptor
is ready. We saw such behaviour on some hardware platforms.
This patch is solving this by treating such situation as normal.
Signed-off-by: Pavel Shirshov <pavel.contrib(a)gmail.com>
---
teamd/teamd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/teamd/teamd.c b/teamd/teamd.c
index e035ac5..8cdc16d 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -265,6 +265,10 @@ static int handle_period_fd(int fd)
teamd_log_err("read() failed.");
return -errno;
}
+ if (ret == 0) {
+ teamd_log_warn("read() for timer_fd returned 0.");
+ return 0;
+ }
if (ret != sizeof(uint64_t)) {
teamd_log_err("read() returned unexpected number of bytes.");
return -EINVAL;
--
2.7.4