From fe66f24c698948e0d7ff8ce6e1e97dc9fb0f83d5 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Fri, 9 Mar 2018 08:34:43 +0800 Subject: [PATCH] [DFS] Add lastdata for poll of netsocket --- components/dfs/filesystems/net/dfs_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/dfs/filesystems/net/dfs_net.c b/components/dfs/filesystems/net/dfs_net.c index 5e84c4054..67f8fe8a7 100644 --- a/components/dfs/filesystems/net/dfs_net.c +++ b/components/dfs/filesystems/net/dfs_net.c @@ -21,6 +21,7 @@ * Date Author Notes * 2015-02-17 Bernard First version * 2016-05-07 Bernard Rename dfs_lwip to dfs_net + * 2018-03-09 Bernard Fix the last data issue in poll. */ #include @@ -104,7 +105,7 @@ static int dfs_net_poll(struct dfs_fd *file, struct rt_pollreq *req) rt_poll_add(&sock->wait_head, req); level = rt_hw_interrupt_disable(); - if (sock->rcvevent) + if (sock->lastdata || sock->rcvevent) { mask |= POLLIN; }