* [sleepy.penguin] [ANN] sleepy_penguin 3.3.0 - fixes and compatibility improvements
@ 2013-12-30 1:34 7% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2013-12-30 1:34 UTC (permalink / raw)
To: sleepy.penguin
Changes:
Most notably, this fixes memory leaks for any users of inotify
reads, epoll/kevent waiting using short-lived thread. Users of
long-lived threads for these functions (all Rainbows!, yahns, and
zbatery users) are not affected. A fair amount of internal cleanup
was necessary for this.
Compatibility with non-Linux systems without clock_gettime is
improved, thanks to Lin Jen-Shin.
Note: the kevent code is not at all optimized and still uses
RARRAY_PTR, so it likely sucks under rbx and MRI 2.1.
Eric Wong (13):
test_epoll: minor compatibility fix for Ruby 2.1.0
avoid RARRAY_PTR usage for Linux-only bits
init: avoid redefinition warning for _GNU_SOURCE
Rakefile: kill raa_update task
util: minor cleanup to favor rb_io_get_io
tests: switch to minitest
test_epoll: switch test_dup_and_fork to exit!
remove all signalfd-related files
tests: remove version-dependent FD_CLOEXEC checks
work around lack of rb_io_get_io in Rubinius
value2timespec: use StringValueCStr for correctness
refactor and fix leak from thread-local storage use
extconf: avoid unnecessary linkage against libkqueue
Lin Jen-Shin (1):
Support for broken system without clock_gettime.
* http://bogomips.org/sleepy_penguin/
* sleepy.penguin@librelist.org
* git://bogomips.org/sleepy_penguin.git
* http://bogomips.org/sleepy_penguin/NEWS.atom.xml
^ permalink raw reply [relevance 7%]
* [sleepy.penguin] [PATCH 2/2] tests: remove version-dependent FD_CLOEXEC checks
@ 2013-10-19 17:59 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2013-10-19 17:59 UTC (permalink / raw)
To: sleepy.penguin
Not all versions/implementations of Ruby set FD_CLOEXEC by default.
And it is conceivable MRI will disable the current FD_CLOEXEC
default out of portability concerns, so we only test that our
code matches.
---
test/helper.rb | 9 +++++++++
test/test_epoll.rb | 6 +-----
test/test_eventfd.rb | 6 +-----
test/test_inotify.rb | 6 +-----
test/test_timerfd.rb | 6 +-----
5 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/test/helper.rb b/test/helper.rb
index 13f79b7..8261168 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -6,3 +6,12 @@ Testcase = begin
rescue NameError
Minitest::Unit::TestCase # minitest 4
end
+
+def check_cloexec(io)
+ pipe = IO.pipe
+ rbimp = Fcntl::FD_CLOEXEC & pipe[0].fcntl(Fcntl::F_GETFD)
+ ours = Fcntl::FD_CLOEXEC & io.fcntl(Fcntl::F_GETFD)
+ assert_equal rbimp, ours, "CLOEXEC default does not match Ruby implementation"
+ensure
+ pipe.each { |io| io.close }
+end
diff --git a/test/test_epoll.rb b/test/test_epoll.rb
index 88d0b6c..61b6e8c 100644
--- a/test/test_epoll.rb
+++ b/test/test_epoll.rb
@@ -348,11 +348,7 @@ class TestEpoll < Testcase
def test_new
@ep.close
io = Epoll.new.to_io
- if RUBY_VERSION.to_f >= 2.0
- assert_equal 1, io.fcntl(Fcntl::F_GETFD)
- else
- assert_equal 0, io.fcntl(Fcntl::F_GETFD)
- end
+ check_cloexec(io)
end
def test_delete
diff --git a/test/test_eventfd.rb b/test/test_eventfd.rb
index 731a6cb..a6b3016 100644
--- a/test/test_eventfd.rb
+++ b/test/test_eventfd.rb
@@ -20,11 +20,7 @@ class TestEventFD < Testcase
def test_new
efd = EventFD.new 0
assert_kind_of(IO, efd)
- if RUBY_VERSION.to_f >= 2.0
- assert_equal 1, efd.fcntl(Fcntl::F_GETFD)
- else
- assert_equal 0, efd.fcntl(Fcntl::F_GETFD)
- end
+ check_cloexec(efd)
end
def test_new_nonblock
diff --git a/test/test_inotify.rb b/test/test_inotify.rb
index c91d6e4..5cf5839 100644
--- a/test/test_inotify.rb
+++ b/test/test_inotify.rb
@@ -17,11 +17,7 @@ class TestInotify < Testcase
def test_new
@ino = Inotify.new
assert_kind_of(IO, ino)
- if RUBY_VERSION.to_f >= 2.0
- assert_equal 1, ino.fcntl(Fcntl::F_GETFD)
- else
- assert_equal 0, ino.fcntl(Fcntl::F_GETFD)
- end
+ check_cloexec(ino)
end
def test_constants
diff --git a/test/test_timerfd.rb b/test/test_timerfd.rb
index 23940a1..6189168 100644
--- a/test/test_timerfd.rb
+++ b/test/test_timerfd.rb
@@ -15,11 +15,7 @@ class TestTimerFD < Testcase
def test_create
tfd = TimerFD.new
assert_kind_of(IO, tfd)
- if RUBY_VERSION.to_f >= 2.0
- assert_equal 1, tfd.fcntl(Fcntl::F_GETFD)
- else
- assert_equal 0, tfd.fcntl(Fcntl::F_GETFD)
- end
+ check_cloexec(tfd)
end
def test_create_nonblock
--
1.8.4.483.g7fe67e6.dirty
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-10-19 17:59 [sleepy.penguin] [PATCH 1/2] remove all signalfd-related files Eric Wong
2013-10-19 17:59 7% ` [sleepy.penguin] [PATCH 2/2] tests: remove version-dependent FD_CLOEXEC checks Eric Wong
2013-12-30 1:34 7% [sleepy.penguin] [ANN] sleepy_penguin 3.3.0 - fixes and compatibility improvements Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/sleepy_penguin.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).