From 0f270afda89ff94b10686f2fdc72ce751f243de5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 29 Mar 2021 08:57:11 +0200 Subject: [PATCH] Kernel: Let's allow unsetting non-blocking mode with FIONBIO as well Thanks to almightyhydra for pointing this out! :^) --- Kernel/Syscalls/ioctl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Syscalls/ioctl.cpp b/Kernel/Syscalls/ioctl.cpp index acff91dfd1..9b0ba6e8dc 100644 --- a/Kernel/Syscalls/ioctl.cpp +++ b/Kernel/Syscalls/ioctl.cpp @@ -35,8 +35,8 @@ KResultOr Process::sys$ioctl(int fd, unsigned request, FlatPtr arg) auto description = file_description(fd); if (!description) return EBADF; - if (request == FIONBIO && arg != 0) { - description->set_blocking(false); + if (request == FIONBIO) { + description->set_blocking(arg != 0); return KSuccess; } return description->file().ioctl(*description, request, arg);