net/local: correct the socket flags from server socket

newsock = accept(server, &addr, &addrlen);

replace the socket flags from newsock to server to ensure that
the nonblock flags is handled correctly

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-03-15 18:47:50 +08:00 committed by Masayuki Ishikawa
parent 81130bc692
commit 40f056e92c
1 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
*/
ret = local_open_server_tx(
conn, _SS_ISNONBLOCK(conn->lc_conn.s_flags));
conn, _SS_ISNONBLOCK(server->lc_conn.s_flags));
if (ret < 0)
{
nerr("ERROR: Failed to open write-only FIFOs for %s: %d\n",
@ -202,7 +202,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
*/
ret = local_open_server_rx(
conn, _SS_ISNONBLOCK(conn->lc_conn.s_flags));
conn, _SS_ISNONBLOCK(server->lc_conn.s_flags));
if (ret < 0)
{
nerr("ERROR: Failed to open read-only FIFOs for %s: %d\n",