mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 10:58:49 +08:00
usrsock_server: Do not poll SOCK_CTRL.
It seems that we don't need to poll the SOCK_CTRL sockets, so skip them in usrsock server. Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
61ff04b9e2
commit
9fd4d6b767
1 changed files with 12 additions and 4 deletions
|
@ -1027,8 +1027,16 @@ static void usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
|
||||||
pollevent_t events)
|
pollevent_t events)
|
||||||
{
|
{
|
||||||
FAR struct usrsock_rpmsg_s *priv = (FAR struct usrsock_rpmsg_s *)pfds->arg;
|
FAR struct usrsock_rpmsg_s *priv = (FAR struct usrsock_rpmsg_s *)pfds->arg;
|
||||||
|
FAR struct socket *psock = &priv->socks[pfds->fd];
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
/* No poll for SOCK_CTRL. */
|
||||||
|
|
||||||
|
if (psock->s_type == SOCK_CTRL)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
net_lock();
|
net_lock();
|
||||||
|
|
||||||
if (events)
|
if (events)
|
||||||
|
@ -1037,7 +1045,7 @@ static void usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
|
||||||
{
|
{
|
||||||
pfds->revents = 0;
|
pfds->revents = 0;
|
||||||
pfds->events = events;
|
pfds->events = events;
|
||||||
ret = psock_poll(&priv->socks[pfds->fd], pfds, true);
|
ret = psock_poll(psock, pfds, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1047,15 +1055,15 @@ static void usrsock_rpmsg_poll_setup(FAR struct pollfd *pfds,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pfds->events = 0;
|
pfds->events = 0;
|
||||||
ret = psock_poll(&priv->socks[pfds->fd], pfds, false);
|
ret = psock_poll(psock, pfds, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nerr("psock_poll failed. ret %d domain %u type %u pfds->fd %d"
|
nerr("psock_poll failed. ret %d domain %u type %u pfds->fd %d"
|
||||||
", pfds->events %08" PRIx32 ", pfds->revents %08" PRIx32,
|
", pfds->events %08" PRIx32 ", pfds->revents %08" PRIx32,
|
||||||
ret, priv->socks[pfds->fd].s_domain, priv->socks[pfds->fd].s_type,
|
ret, psock->s_domain, psock->s_type, pfds->fd,
|
||||||
pfds->fd, pfds->events, pfds->revents);
|
pfds->events, pfds->revents);
|
||||||
}
|
}
|
||||||
|
|
||||||
net_unlock();
|
net_unlock();
|
||||||
|
|
Loading…
Reference in a new issue