summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-21 14:16:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-21 15:14:08 +0900
commitee48c9cda6e918f8da4b23d3ff4fabf7357f4a95 (patch)
tree1fd13a1f4fb1cb43381aa6331e883a1c4ee9b1ca /win32/win32.c
parentb4f87ff83857601dd1cc3822cc505bb45ab7d8b3 (diff)
[Win32] allow pipe in flock
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c10
1 files 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) {}
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, ...)
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;