diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2020-05-14 22:10:55 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 22:10:55 +1200 |
commit | 0e3b0fcdba70cf96a8e0654eb8f50aacb8024bd4 (patch) | |
tree | 74d381412dfd8ff49dd3039f8aeae09ad9e4e6e3 /ext/socket/ancdata.c | |
parent | 336119dfc5e6baae0a936d6feae780a61975479c (diff) |
Thread scheduler for light weight concurrency.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3032
Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r-- | ext/socket/ancdata.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 84463af061..e0fc247f8c 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -2,7 +2,6 @@ #include <time.h> -int rsock_cmsg_cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */ static VALUE sym_wait_readable, sym_wait_writable; #if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) @@ -1429,10 +1428,7 @@ make_io_for_unix_rights(VALUE ctl, struct cmsghdr *cmh, char *msg_end) if (fstat(fd, &stbuf) == -1) rb_raise(rb_eSocket, "invalid fd in SCM_RIGHTS"); rb_update_max_fd(fd); - if (rsock_cmsg_cloexec_state < 0) - rsock_cmsg_cloexec_state = rsock_detect_cloexec(fd); - if (rsock_cmsg_cloexec_state == 0 || fd <= 2) - rb_maygvl_fd_fix_cloexec(fd); + rb_maygvl_fd_fix_cloexec(fd); if (S_ISSOCK(stbuf.st_mode)) io = rsock_init_sock(rb_obj_alloc(rb_cSocket), fd); else |