File 0015-test-fix-up-wait_for_single_fd-to-accept-RB_WAITFD_E.patch of Package ruby2.5
From a5cadb99ac4561d6453806a46de66de1ef285af7 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Fri, 7 Feb 2020 02:02:07 +0100
Subject: [PATCH 15/19] test: fix up wait_for_single_fd to accept
RB_WAITFD_ERR.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
ext/-test-/wait_for_single_fd/wait_for_single_fd.c | 1 +
test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ext/-test-/wait_for_single_fd/wait_for_single_fd.c b/ext/-test-/wait_for_single_fd/wait_for_single_fd.c
index d406724a3f2e..3e9310537091 100644
--- a/ext/-test-/wait_for_single_fd/wait_for_single_fd.c
+++ b/ext/-test-/wait_for_single_fd/wait_for_single_fd.c
@@ -25,6 +25,7 @@ Init_wait_for_single_fd(void)
rb_define_const(rb_cObject, "RB_WAITFD_IN", INT2NUM(RB_WAITFD_IN));
rb_define_const(rb_cObject, "RB_WAITFD_OUT", INT2NUM(RB_WAITFD_OUT));
rb_define_const(rb_cObject, "RB_WAITFD_PRI", INT2NUM(RB_WAITFD_PRI));
+ rb_define_const(rb_cObject, "RB_WAITFD_ERR", INT2NUM(RB_WAITFD_ERR));
rb_define_singleton_method(rb_cIO, "wait_for_single_fd",
wait_for_single_fd, 3);
}
diff --git a/test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb b/test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
index 1141dd317c88..7b56ba96d170 100644
--- a/test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
+++ b/test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
@@ -45,7 +45,11 @@ def test_wait_for_closed_pipe
with_pipe do |r,w|
w.close
rc = IO.wait_for_single_fd(r.fileno, RB_WAITFD_IN, nil)
- assert_equal RB_WAITFD_IN, rc
+ if IO.methods.include? :select_with_poll then
+ assert_equal RB_WAITFD_IN|RB_WAITFD_ERR, rc
+ else
+ assert_equal RB_WAITFD_IN, rc
+ end
end
end
--
2.26.2