prometheus-client-mmap 0.7.0.beta45.8 → 0.7.0.beta45.9

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
  SHA1:
3
- metadata.gz: d3a4f6437893fb0f0ed20e69a0fccc1ad297de91
4
- data.tar.gz: 7c5afaa261b5b1810b8b7e350a05977ca1ee3180
3
+ metadata.gz: 26cd3edd6cdca37f12302661dcc43f4ef1fa2426
4
+ data.tar.gz: 572236f8217e968c1f2f229a8b4303e570ad838f
5
5
  SHA512:
6
- metadata.gz: 5c450ca0c85ecea836356cf21bc56f003e34a482e86351d59bb57b2cdb62d6b800d03ba4495398093bad39d4b59951f297ae5fa5d07352234befa730429435e8
7
- data.tar.gz: 5a0cab7e6177d8b0aab8b836ed6160872aec54ba5978b83ef59f80f5d868c169f3dd843ae76e73060162b6dd638422f3806e5cc26efe5db07cc142104fdca979
6
+ metadata.gz: a5b3f0d352da5227e3611bb246105f5a5f1e4f28addaa1ab99ed942e56a502b135b205e83e8fb55972337c851665ba396904821310ac1b3d1722d29ab4753110
7
+ data.tar.gz: e0e9af3be98632d44649882878aa5d20349187010746b7dffa84586910a469ae46a2197f73d915d351c1112905c8152c93dfe9bb42fe94d222fdad24587ef3bb
@@ -34,12 +34,14 @@ static int open_and_extend_file(mm_ipc *i_mm, size_t len, int *fd_p) {
34
34
  }
35
35
 
36
36
  static int perform_munmap(mm_ipc *i_mm) {
37
- if (i_mm->t->addr > 0 && munmap(i_mm->t->addr, i_mm->t->len)) {
38
- i_mm->t->addr = 0;
37
+ if (i_mm->t->addr != NULL && munmap(i_mm->t->addr, i_mm->t->len)) {
38
+ i_mm->t->addr = NULL;
39
39
  return with_exception(rb_eArgError, "munmap failed");
40
40
  }
41
41
 
42
- i_mm->t->addr = 0;
42
+ i_mm->t->addr = NULL;
43
+ i_mm->t->len = 0;
44
+ i_mm->t->real = 0;
43
45
 
44
46
  return SUCCESS;
45
47
  }
@@ -50,6 +52,7 @@ static int perform_mmap(mm_ipc *i_mm, int fd, size_t len) {
50
52
  if (addr == MAP_FAILED) {
51
53
  return with_exception(rb_eArgError, "mmap failed");
52
54
  }
55
+
53
56
  i_mm->t->addr = addr;
54
57
  i_mm->t->len = len;
55
58
  i_mm->t->real = len;
@@ -66,7 +69,8 @@ static int expand(mm_ipc *i_mm, size_t len) {
66
69
  return FAILURE;
67
70
  }
68
71
 
69
- int fd;
72
+ int fd = 0;
73
+
70
74
  if (!open_and_extend_file(i_mm, len, &fd)) {
71
75
  return FAILURE;
72
76
  }
Binary file
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.7.0.beta45.8'.freeze
3
+ VERSION = '0.7.0.beta45.9'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-client-mmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta45.8
4
+ version: 0.7.0.beta45.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmidt