From 615c4bc6e9a490b83ecd5f6a367573f3ea360729 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 28 Feb 2024 13:34:39 +0800 Subject: [PATCH] net/local: Fix the wrong direction of threshold setting reader should set POLLIN threshold, writer should set POLLOUT threshold. Signed-off-by: Xiang Xiao --- net/local/local_fifo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c index d4739a048e..48776cf647 100644 --- a/net/local/local_fifo.c +++ b/net/local/local_fifo.c @@ -680,13 +680,13 @@ int local_open_receiver(FAR struct local_conn_s *conn, bool nonblock) ret = local_set_policy(&conn->lc_infile, 1); if (ret == 0) { - /* Set POLLOUT threshold bigger than preamble len. + /* Set POLLIN threshold bigger than preamble len. * This is to avoid non-blocking read failed with -EAGAIN when * only preamble len is sent and read by reader. */ - ret = local_set_polloutthreshold(&conn->lc_infile, - sizeof(uint16_t)); + ret = local_set_pollinthreshold(&conn->lc_infile, + sizeof(uint16_t)); } } @@ -723,13 +723,13 @@ int local_open_sender(FAR struct local_conn_s *conn, FAR const char *path, ret = local_set_policy(&conn->lc_outfile, 1); if (ret == 0) { - /* Set POLLIN threshold bigger than preamble len. + /* Set POLLOUT threshold bigger than preamble len. * This is to avoid non-blocking write failed with -EAGAIN when * only preamble len is sent and read by reader. */ - ret = local_set_pollinthreshold(&conn->lc_outfile, - sizeof(uint16_t)); + ret = local_set_polloutthreshold(&conn->lc_outfile, + sizeof(uint16_t)); } }