From 53ec96777c32d610c7bc2d387d2c098749d49a18 Mon Sep 17 00:00:00 2001 From: Simon Zhang Date: Fri, 7 Aug 2020 05:20:47 +0800 Subject: vcl: fix getting wrong non-blocking flags issue in VPPCOM_ATTR_GET_FLAGS action Type: fix Signed-off-by: Simon Zhang Change-Id: If4c700b59b8936a43d6a73ed75cc6fdaf6cf141d --- src/vcl/vppcom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vcl') 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, -- cgit 1.2.3-korg