Skip to content

Commit 11804d2

Browse files
committed
Fix usage of uninitialized ::DL in Ruby 1.9.3
When compiling Ruby 1.9.3 with clang, Fiddle is compiled in while DL is not. This commit fixes an usage of the DL module in the case it's not compiled in. Unfortunately Fiddle::Handle and Fiddle.dlopen were only added in Ruby 2, but a dlopen call (available as part of the DL module) is needed to use Fiddle::Function. Fixes #274
1 parent 131287d commit 11804d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/spring/sid.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def self.sid
2525
if Process.respond_to?(:getsid)
2626
# Ruby 2
2727
Process.getsid
28-
elsif defined?(Fiddle)
28+
elsif defined?(Fiddle) and defined?(DL)
2929
# Ruby 1.9.3 compiled with libffi support
3030
fiddle_func.call(0)
3131
else

0 commit comments

Comments
 (0)