diff options
author | Emmanuel Bouthenot <kolter@openics.org> | 2008-09-07 16:57:39 +0000 |
---|---|---|
committer | Emmanuel Bouthenot <kolter@openics.org> | 2008-09-07 16:57:39 +0000 |
commit | da4e0e03a57f5b65cd934461cea2979ef9c390f3 (patch) | |
tree | c8b3b37539eefd586f4c0c0c461d76fbe0217a35 /src | |
parent | 479ce5d3cae13a774a0e4a1b04bdbfb44955a278 (diff) | |
download | weechat-da4e0e03a57f5b65cd934461cea2979ef9c390f3.zip |
Fix probable pthread mutex lock on hppa architecture with perl plugin (Debian Bug #495080).
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index c9f5b2635..21266aa13 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -53,6 +53,9 @@ static PerlInterpreter *perl_main = NULL; int perl_num = 0; #endif +char *perl_args[] = { "", "-e", "0", "-w", NULL }; +int perl_args_count = 4; + char *perl_weechat_code = { #ifndef MULTIPLICITY @@ -234,7 +237,6 @@ weechat_perl_load (const char *filename) #ifdef MULTIPLICITY PerlInterpreter *perl_current_interpreter; - char *perl_args[] = { "", "-e", "0" }; #else char pkgname[64]; #endif @@ -270,8 +272,8 @@ weechat_perl_load (const char *filename) PERL_SET_CONTEXT (perl_current_interpreter); perl_construct (perl_current_interpreter); tempscript.interpreter = (PerlInterpreter *) perl_current_interpreter; - perl_parse (perl_current_interpreter, weechat_perl_api_init, 3, perl_args, - NULL); + perl_parse (perl_current_interpreter, weechat_perl_api_init, + perl_args_count, perl_args, NULL); eval_pv (perl_weechat_code, TRUE); perl_argv[0] = (char *)filename; @@ -613,14 +615,16 @@ weechat_perl_buffer_closed_cb (void *data, const char *signal, const char *type_ int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) { -#ifndef MULTIPLICITY - char *perl_args[] = { "", "-e", "0" }; -#endif - /* make C compiler happy */ (void) argc; (void) argv; +#ifdef PERL_SYS_INIT3 + int a = perl_args_count; + char *perl_env[] = {}; + PERL_SYS_INIT3 (&a, (char ***)&perl_args, (char ***)&perl_env); +#endif + weechat_perl_plugin = plugin; #ifndef MULTIPLICITY @@ -635,7 +639,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) } perl_construct (perl_main); - perl_parse (perl_main, weechat_perl_api_init, 3, perl_args, NULL); + perl_parse (perl_main, weechat_perl_api_init, perl_args_count, + perl_args, NULL); eval_pv (perl_weechat_code, TRUE); #endif @@ -672,6 +677,10 @@ weechat_plugin_end (struct t_weechat_plugin *plugin) perl_main = NULL; } #endif + +#ifdef PERL_SYS_TERM + PERL_SYS_TERM (); +#endif return WEECHAT_RC_OK; } |