From bc0ca512434173591914da4c326fd68be66ff2a4 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 1 Apr 2022 14:27:24 +0900 Subject: [PATCH] netdev_file_ioctl: Fix fcntl F_SETFL O_NONBLOCK regression This fixes a regression caused by the following commit, which prevents the file flag from being updated. ``` commit 28860b5242dd5efd86b5da8a089e5d898cd8a9a1 Author: chao.an Date: Sat Mar 19 14:47:37 2022 +0800 net/netdev: fix switch case missing break Signed-off-by: chao.an ``` Note: some applications like mbedtls uses F_GETFL to confirm the nonblock-ness of the socket. This is critical for such applications. --- net/netdev/netdev_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 21d156afc58..cd9296613e6 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -1522,7 +1522,7 @@ static int netdev_file_ioctl(FAR struct socket *psock, int cmd, conn->s_flags &= ~_SF_NONBLOCK; } - ret = OK; + ret = -ENOTTY; /* let file_vioctl update f_oflags */ } else {