From 40f056e92ceb347d6028ff1d64bdb38ad7432e6e Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Tue, 15 Mar 2022 18:47:50 +0800 Subject: [PATCH] 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 --- net/local/local_accept.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/local/local_accept.c b/net/local/local_accept.c index 835e7af338..47551ed9b9 100644 --- a/net/local/local_accept.c +++ b/net/local/local_accept.c @@ -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",