From 7ac2d3a5acc5cddbb24814a407ad7e11eec6aecf Mon Sep 17 00:00:00 2001 From: anjiahao Date: Tue, 19 Apr 2022 17:06:05 +0800 Subject: [PATCH] fs:oflag need consistent with psock if don't consistent with psock,call fcntl will have differet flag Signed-off-by: anjiahao --- fs/socket/socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/socket/socket.c b/fs/socket/socket.c index 1245c79a53..4ca9f2a9a1 100644 --- a/fs/socket/socket.c +++ b/fs/socket/socket.c @@ -261,6 +261,11 @@ int socket(int domain, int type, int protocol) oflags |= O_CLOEXEC; } + if (type & SOCK_NONBLOCK) + { + oflags |= O_NONBLOCK; + } + psock = kmm_zalloc(sizeof(*psock)); if (psock == NULL) {