[Pkg-privacy-commits] [irssi-plugin-otr] 168/267: Add a directory check when loading

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit d0b7efacfe0786b46e2e9e27bc90db01ead47e73
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Sat Dec 1 22:38:11 2012 -0500

    Add a directory check when loading
    
    Set libgcrypt thread model so it does not assert when searching for the
    mutex_lock operation.
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/module.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/module.c b/src/module.c
index 9c2d099..81926b6 100644
--- a/src/module.c
+++ b/src/module.c
@@ -32,6 +32,8 @@
 #include "otr-formats.h"
 #include "utils.h"
 
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+
 static const char *signal_args_otr_event[] = {
 	"iobject", "string", "string", "NULL"
 };
@@ -261,10 +263,13 @@ static int create_module_dir(void)
 		goto error_alloc;
 	}
 
-	ret = mkdir(dir_path, S_IRWXU);
+	ret = access(dir_path, F_OK);
 	if (ret < 0) {
-		IRSSI_MSG("Unable to create %s directory.", dir_path);
-		goto error;
+		ret = mkdir(dir_path, S_IRWXU);
+		if (ret < 0) {
+			IRSSI_MSG("Unable to create %s directory.", dir_path);
+			goto error;
+		}
 	}
 
 error:
@@ -299,6 +304,8 @@ void otr_init(void)
 		return;
 	}
 
+	gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+
 	otr_lib_init();
 
 	/*

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list