io-event 1.0.3 → 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: 702073dbb4f3ae83c132f359f31cd28ff1773fd59555ee4d55f53da963cab6c0
4
- data.tar.gz: a3237cb6b6499259203da3d26d4ecc67cf019dac3ebb5f1b0636f2148ddc08b5
3
+ metadata.gz: bbc13d55bf16de818e95478a83d0da64de1b9844bf92fd2970df3e8cc42d8240
4
+ data.tar.gz: 41e8fb1ad62705688c44ff774e44360ffef8223c8d308c01d1163b66b67c3abe
5
5
  SHA512:
6
- metadata.gz: 686ff45aecfa4bc3c79328595291d05e1c5887656a054ded3ee6108208ab03a6320d5c82cc8e171533630993c514455a6775ee076b3e0c43af592b065f040f19
7
- data.tar.gz: c653fb07fab4818a7c9aa46ba97e1b0bc9490c4a3df632c9195874b6ba616ed48d760492e6995fe68ca4ac45f69e80f6d0bce7b7370d7eabdc4192ae831fc3e0
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
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module IO::Event
22
- VERSION = "1.0.3"
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.3
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-03-07 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.