io-event 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 050c0a061c54668eaf5d41eab6d70644410a0e6469b7e68cd26a6fa7c4a50f8a
4
- data.tar.gz: 22be34dad07b0f75fc68045ff17b92c29ffbebdc06e4f570d3f92758d8532192
3
+ metadata.gz: bbc13d55bf16de818e95478a83d0da64de1b9844bf92fd2970df3e8cc42d8240
4
+ data.tar.gz: 41e8fb1ad62705688c44ff774e44360ffef8223c8d308c01d1163b66b67c3abe
5
5
  SHA512:
6
- metadata.gz: 92a187c8f2034aba8c33117fdc48a4055112cf1ea481a77d5fa7acc84683bedd04e295cb01e29c66ca2b23851debe8f86ec306d183c6c8474f5c44c2aef461da
7
- data.tar.gz: 9e4da7190480b3d56556c440ebf922134e139b93cdd8c6ca5f8b7cea24c15bb8b943e6437b0c492d135f76dfaec32d63cc3ed43987545436c116d43e16ca5c4c
6
+ metadata.gz: 878bb331d512cd99115da6451c07e06160fcf868e208280ef042d652be2d5cd606b1bb14623337ff1672729cb2f20b78f85232fd793a5baea274b3b5159a51ef
7
+ data.tar.gz: 85fc1b0faa924bb3c4f62de80262275a321f8b36a23954f110e9e78e7d7c156a0df62b3bdcc1feabaff14ab14107db6f37d51aa7ad0d00c139690b7231b482c4
@@ -231,6 +231,11 @@ VALUE IO_Event_Selector_EPoll_process_wait(VALUE self, VALUE fiber, VALUE pid, V
231
231
  };
232
232
 
233
233
  process_wait_arguments.descriptor = pidfd_open(process_wait_arguments.pid, 0);
234
+
235
+ if (process_wait_arguments.descriptor == -1) {
236
+ rb_sys_fail("IO_Event_Selector_EPoll_process_wait:pidfd_open");
237
+ }
238
+
234
239
  rb_update_max_fd(process_wait_arguments.descriptor);
235
240
 
236
241
  struct epoll_event event = {
@@ -241,6 +246,7 @@ VALUE IO_Event_Selector_EPoll_process_wait(VALUE self, VALUE fiber, VALUE pid, V
241
246
  int result = epoll_ctl(data->descriptor, EPOLL_CTL_ADD, process_wait_arguments.descriptor, &event);
242
247
 
243
248
  if (result == -1) {
249
+ close(process_wait_arguments.descriptor);
244
250
  rb_sys_fail("IO_Event_Selector_EPoll_process_wait:epoll_ctl");
245
251
  }
246
252
 
@@ -330,13 +336,15 @@ VALUE IO_Event_Selector_EPoll_io_wait(VALUE self, VALUE fiber, VALUE io, VALUE e
330
336
 
331
337
  rb_update_max_fd(duplicate);
332
338
 
333
- if (descriptor == -1)
339
+ if (descriptor == -1) {
334
340
  rb_sys_fail("IO_Event_Selector_EPoll_io_wait:dup");
341
+ }
335
342
 
336
343
  result = epoll_ctl(data->descriptor, EPOLL_CTL_ADD, descriptor, &event);
337
344
  }
338
345
 
339
346
  if (result == -1) {
347
+ if (duplicate >= 0) close(duplicate);
340
348
  rb_sys_fail("IO_Event_Selector_EPoll_io_wait:epoll_ctl");
341
349
  }
342
350
 
@@ -21,6 +21,11 @@
21
21
  #include "selector.h"
22
22
  #include <fcntl.h>
23
23
 
24
+ #ifndef HAVE_RB_PROCESS_STATUS_WAIT
25
+ // Pull in WNOHANG.
26
+ #include <sys/wait.h>
27
+ #endif
28
+
24
29
  static const int DEBUG = 0;
25
30
 
26
31
  static ID id_transfer, id_alive_p;
@@ -47,12 +47,9 @@ module IO::Event
47
47
  @selector = nil
48
48
  end
49
49
 
50
- def transfer(fiber, *arguments)
51
- @selector.transfer(fiber, *arguments)
52
- end
53
-
54
- def transfer(*arguments)
55
- @selector.transfer(*arguments)
50
+ # Transfer from the calling fiber to the event loop.
51
+ def transfer
52
+ @selector.transfer
56
53
  end
57
54
 
58
55
  def resume(*arguments)
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module IO::Event
22
- VERSION = "1.0.2"
22
+ VERSION = "1.0.4"
23
23
  end
metadata CHANGED
@@ -1,14 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - machty
9
+ - Benoit Daloze
10
+ - Delton Ding
8
11
  autorequire:
9
12
  bindir: bin
10
13
  cert_chain: []
11
- date: 2022-01-14 00:00:00.000000000 Z
14
+ date: 2022-03-09 00:00:00.000000000 Z
12
15
  dependencies:
13
16
  - !ruby/object:Gem::Dependency
14
17
  name: bake
@@ -120,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
123
  - !ruby/object:Gem::Version
121
124
  version: '0'
122
125
  requirements: []
123
- rubygems_version: 3.2.32
126
+ rubygems_version: 3.3.8
124
127
  signing_key:
125
128
  specification_version: 4
126
129
  summary: An event loop.