ruby-changes:71785
From: Nobuyoshi <ko1@a...>
Date: Thu, 21 Apr 2022 15:14:51 +0900 (JST)
Subject: [ruby-changes:71785] ee48c9cda6 (master): [Win32] allow pipe in flock
https://git.ruby-lang.org/ruby.git/commit/?id=ee48c9cda6 From ee48c9cda6e918f8da4b23d3ff4fabf7357f4a95 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 21 Apr 2022 14:16:26 +0900 Subject: [Win32] allow pipe in flock --- win32/win32.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index ea9624876c..607603cf04 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4298,6 +4298,8 @@ void setprotoent (int stayopen) {} https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4298 void setservent (int stayopen) {} #endif +int rb_w32_set_nonblock2(int fd, int nonblock); + /* License: Ruby's */ static int setfl(SOCKET sock, int arg) @@ -4373,16 +4375,10 @@ fcntl(int fd, int cmd, ...) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4375 switch (cmd) { case F_SETFL: { - SOCKET sock = TO_SOCKET(fd); - if (!is_socket(sock)) { - errno = EBADF; - return -1; - } - va_start(va, cmd); arg = va_arg(va, int); va_end(va); - return setfl(sock, arg); + return rb_w32_set_nonblock2(fd, arg); } case F_DUPFD: case F_DUPFD_CLOEXEC: { int ret; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/