summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorSimon Zhang <yuwei1.zhang@intel.com>2020-08-07 05:20:47 +0800
committerSimon Zhang <yuwei1.zhang@intel.com>2020-08-09 01:37:07 +0000
commit53ec96777c32d610c7bc2d387d2c098749d49a18 (patch)
treefe72080e5270f35051772850e4f007d71567f9e3 /src/vcl/vppcom.c
parent6042d28155a5470827c9756b39a405fe4e2cd84b (diff)
vcl: fix getting wrong non-blocking flags issue in VPPCOM_ATTR_GET_FLAGS action
Type: fix Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: If4c700b59b8936a43d6a73ed75cc6fdaf6cf141d
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index fd9136aa9fc..f1478f890c9 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3081,8 +3081,10 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
case VPPCOM_ATTR_GET_FLAGS:
if (PREDICT_TRUE (buffer && buflen && (*buflen >= sizeof (*flags))))
{
- *flags = O_RDWR | (VCL_SESS_ATTR_TEST (session->attr,
- VCL_SESS_ATTR_NONBLOCK));
+ *flags =
+ O_RDWR |
+ (VCL_SESS_ATTR_TEST (session->attr, VCL_SESS_ATTR_NONBLOCK) ?
+ O_NONBLOCK : 0);
*buflen = sizeof (*flags);
VDBG (2, "VPPCOM_ATTR_GET_FLAGS: sh %u, flags = 0x%08x, "
"is_nonblocking = %u", session_handle, *flags,