Permalink
Browse files

Merge pull request #125 from digital-science/fix_ssh2_crash

initialize threading in ssh2 module
  • Loading branch information...
2 parents 9b93e9a + f22693d commit 6190acd6f9f05160f76f59affe1496742d51aa48 @postwait postwait committed Dec 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/modules/ssh2.c
View
@@ -48,6 +48,7 @@
#include "utils/noit_hash.h"
#include <libssh2.h>
+#include <gcrypt.h>
#define DEFAULT_SSH_PORT 22
@@ -103,7 +104,11 @@ static void ssh2_cleanup(noit_module_t *self, noit_check_t *check) {
memset(ci, 0, sizeof(*ci));
}
}
+
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+
static int ssh2_init(noit_module_t *self) {
+ gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
return 0;
}
static int ssh2_config(noit_module_t *self, noit_hash_table *options) {

0 comments on commit 6190acd

Please sign in to comment.