about summary refs log tree commit homepage
path: root/lib/dtas/sigevent.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-20 01:39:14 +0000
committerEric Wong <e@80x24.org>2020-01-06 08:15:13 +0000
commit940c0b3cffa7f691620e7890ada15c7519817307 (patch)
tree50674c3892983abdb78fa2a8597865edf6b05c79 /lib/dtas/sigevent.rb
parent044d1e1777f37a77084794fadce86b4865a1ccfc (diff)
downloaddtas-940c0b3cffa7f691620e7890ada15c7519817307.tar.gz
sleepy_penguin requires a compiler and development headers to
install, so it could be a PITA to install for users on
distro-provided Ruby.  Allow fiddle since it's part of the Ruby
standard library since 1.9.2 and users won't have to install
anything else.
Diffstat (limited to 'lib/dtas/sigevent.rb')
-rw-r--r--lib/dtas/sigevent.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/dtas/sigevent.rb b/lib/dtas/sigevent.rb
index d4a96d7..74d22df 100644
--- a/lib/dtas/sigevent.rb
+++ b/lib/dtas/sigevent.rb
@@ -3,8 +3,11 @@
 # frozen_string_literal: true
 begin
   raise LoadError, "no eventfd with _DTAS_POSIX" if ENV["_DTAS_POSIX"]
-  require 'sleepy_penguin'
-  require_relative 'sigevent/efd'
+  begin
+    require_relative 'sigevent/efd'
+  rescue LoadError
+    require_relative 'sigevent/fiddle_efd'
+  end
 rescue LoadError
   require_relative 'sigevent/pipe'
 end