diff --git a/ext/libssh_ruby/extconf.rb b/ext/libssh_ruby/extconf.rb index 9a511c4..9b44214 100644 --- a/ext/libssh_ruby/extconf.rb +++ b/ext/libssh_ruby/extconf.rb @@ -8,6 +8,7 @@ have_header('libssh/libssh.h') have_library('ssh') +have_library('ssh_threads') have_const('SSH_KEYTYPE_ED25519', 'libssh/libssh.h') create_makefile('libssh/libssh_ruby') diff --git a/ext/libssh_ruby/libssh_ruby.c b/ext/libssh_ruby/libssh_ruby.c index ad829c6..2a71b7a 100644 --- a/ext/libssh_ruby/libssh_ruby.c +++ b/ext/libssh_ruby/libssh_ruby.c @@ -1,4 +1,5 @@ #include "libssh_ruby.h" +#include VALUE rb_mLibSSH; @@ -26,6 +27,9 @@ static VALUE m_version(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self)) { } void Init_libssh_ruby(void) { + ssh_threads_set_callbacks(ssh_threads_get_pthread()); + ssh_init(); + rb_mLibSSH = rb_define_module("LibSSH"); /* @see Session#server_known */