Permalink
Browse files

Fix JRUBY-4962: "require 'pty'" fails with LoadError: no library spec…

…ified

with a little help from Wayne Meissner.
  • Loading branch information...
BanzaiMan committed Jul 22, 2010
1 parent 71b2a40 commit ad0afa7a18bc5f730c790d967605131c69c1a84c
Showing with 10 additions and 0 deletions.
  1. +2 −0 lib/ruby/site_ruby/shared/pty.rb
  2. +8 −0 test/test_pty.rb
@@ -4,6 +4,7 @@ module PTY
private
module LibUtil
extend FFI::Library
+ ffi_lib FFI::Library::LIBC
# forkpty(3) is in libutil on linux, libc on MacOS/BSD
if FFI::Platform.linux?
ffi_lib 'libutil'
@@ -12,6 +13,7 @@ module LibUtil
end
module LibC
extend FFI::Library
+ ffi_lib FFI::Library::LIBC
attach_function :close, [ :int ], :int
attach_function :strerror, [ :int ], :string
attach_function :execv, [ :string, :buffer_in ], :int
View
@@ -0,0 +1,8 @@
+require 'test/unit'
+
+class LoadPtyTest < Test::Unit::TestCase
+ # JRUBY-4962
+ def test_require_pty
+ assert_nothing_raised { require 'pty' }
+ end
+end

0 comments on commit ad0afa7

Please sign in to comment.