* [ANN] posix_mq 2.4.0 - POSIX Message Queues for Ruby
@ 2017-03-20 19:52 5% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2017-03-20 19:52 UTC (permalink / raw)
To: ruby-talk, ruby-posix-mq
POSIX message queues allow local processes to exchange data in the form
of messages. This API is distinct from that provided by System V
message queues, but provides similar functionality.
* https://bogomips.org/ruby_posix_mq/
* ruby-posix-mq@bogomips.org
* git clone git://bogomips.org/ruby_posix_mq.git
* Atom feed: https://bogomips.org/ruby_posix_mq/NEWS.atom.xml
* Mail archives: https://bogomips.org/ruby-posix-mq/
nntp://news.public-inbox.org/inbox.comp.lang.ruby.posix-mq
* gem install -v 2.4.0 posix_mq
Changes:
Ruby posix_mq 2.4.0
Most notably there are some FreeBSD fixes. There are also
some minor internal cleanups and doc updates.
7 changes since 2.3.0 (2016-02-02):
doc: remove private email address
doc: update bogomips.org URLs to HTTPS
set correct condition for setting id_autoclose
test_posix_mq: get tests passing under FreeBSD 10.3
TypedData C-API conversion
freeze internal objects
build: remove build-time olddoc dependency
^ permalink raw reply [relevance 5%]
* [PATCH] test_posix_mq: get tests passing under FreeBSD 10.3
@ 2017-03-18 8:11 7% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2017-03-18 8:11 UTC (permalink / raw)
To: ruby-posix-mq
Apparently POSIX message queues adopted close-on-fork behavior
in FreeBSD at some point. Oh well, somebody else who is more
interested in FreeBSD than can look into fixing it on their end.
Improve exception reporting a bit while we're at it.
---
test/test_posix_mq.rb | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/test/test_posix_mq.rb b/test/test_posix_mq.rb
index e831012..843b65e 100644
--- a/test/test_posix_mq.rb
+++ b/test/test_posix_mq.rb
@@ -303,9 +303,10 @@ class Test_POSIX_MQ < Test::Unit::TestCase
begin
@mq.notify = :USR1
rescue Errno::EBUSY
- exit 0
+ exit!(0)
rescue => e
- p e
+ exit!(0) if Errno::EBADF === e && RUBY_PLATFORM =~ /freebsd/
+ warn "#{e.message} (#{e.class})\n"
end
exit! 1
end
@@ -326,14 +327,28 @@ class Test_POSIX_MQ < Test::Unit::TestCase
end
def test_setattr_fork
+ return if RUBY_PLATFORM !~ /freebsd/
@mq = POSIX_MQ.new @path, IO::CREAT|IO::WRONLY, 0666
mq_attr = POSIX_MQ::Attr.new(IO::NONBLOCK)
@mq.attr = mq_attr
assert @mq.nonblock?
- pid = fork { @mq.nonblock = false }
- assert Process.waitpid2(pid)[1].success?
- assert ! @mq.nonblock?
+ pid = fork do
+ begin
+ @mq.nonblock = false
+ rescue => e
+ exit!(2) if Errno::EBADF === e && RUBY_PLATFORM =~ /freebsd/
+ warn "#{e.message} (#{e.class})\n"
+ exit!(1)
+ end
+ exit!(0)
+ end
+ _, status = Process.waitpid2(pid)
+ if status.success?
+ assert ! @mq.nonblock?
+ else
+ assert_equal 2, status.exitstatus
+ end
end
def test_new_nonblocking
--
EW
^ 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 --
2017-03-18 8:11 7% [PATCH] test_posix_mq: get tests passing under FreeBSD 10.3 Eric Wong
2017-03-20 19:52 5% [ANN] posix_mq 2.4.0 - POSIX Message Queues for Ruby Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/ruby_posix_mq.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).