rb-kqueue 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rb-kqueue/version.rb +1 -1
- data/lib/rb-kqueue/watcher/file.rb +16 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 523d4296fcd67116273396bc9132da9e83aacfd2dabb268bdcd6ce7de3405406
|
4
|
+
data.tar.gz: a41304312b5eb7aec15c210571edf966f3678763be585a57efe5d7fd878ca009
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd6b826fdab416c3c8f3bb5da0e351158a849d6169545e0ae1833237039ba7c8aa773600b10b40c959ed36e423f1b9f1a44fcfcb00a863a307ba062ccc72e945
|
7
|
+
data.tar.gz: 5cf9e86f55267e5127bd2dfd3eb1754ce006ebd442d5a1707a3abcfbe5068a90e42fbc9f70f49e8fcfcca0b0404f4b32c690bea448d75136380d5499b223c1ae
|
data/lib/rb-kqueue/version.rb
CHANGED
@@ -37,20 +37,24 @@ module KQueue
|
|
37
37
|
FFI.errno)
|
38
38
|
end
|
39
39
|
|
40
|
-
ObjectSpace.define_finalizer(self,
|
41
|
-
next unless Native.close(@fd) < 0
|
42
|
-
raise SystemCallError.new(
|
43
|
-
"Failed to close file #{path}" +
|
44
|
-
case FFI.errno
|
45
|
-
when Errno::EBADF::Errno; ": Invalid file descriptor."
|
46
|
-
when Errno::EINTR::Errno; ": Closing interrupted."
|
47
|
-
when Errno::EIO::Errno; ": IO error."
|
48
|
-
else; ""
|
49
|
-
end,
|
50
|
-
FFI.errno)
|
51
|
-
end)
|
40
|
+
ObjectSpace.define_finalizer(self, self.class.finalizer(@fd, path))
|
52
41
|
super(queue, @fd, :vnode, flags, nil, callback)
|
53
42
|
end
|
43
|
+
|
44
|
+
def self.finalizer(fd, path)
|
45
|
+
lambda do
|
46
|
+
next unless Native.close(fd) < 0
|
47
|
+
raise SystemCallError.new(
|
48
|
+
"Failed to close file #{path}" +
|
49
|
+
case FFI.errno
|
50
|
+
when Errno::EBADF::Errno; ": Invalid file descriptor."
|
51
|
+
when Errno::EINTR::Errno; ": Closing interrupted."
|
52
|
+
when Errno::EIO::Errno; ": IO error."
|
53
|
+
else; ""
|
54
|
+
end,
|
55
|
+
FFI.errno)
|
56
|
+
end
|
57
|
+
end
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rb-kqueue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu Arnold
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|