summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/perl
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-02-18 11:13:23 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-02-18 11:13:23 +0100
commit4d1fdfade0cfb51e9ff680861e3333bd2b24173a (patch)
tree39ce7b5d276134eb5de1625b0c4206d4c09d709e /src/plugins/scripts/perl
parente263a847da839253e346fa3843aaf7cb90199f01 (diff)
downloadweechat-4d1fdfade0cfb51e9ff680861e3333bd2b24173a.zip
Give file descriptor to callback of hook_fd
Diffstat (limited to 'src/plugins/scripts/perl')
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index 6967c6dcf..eb4dd7851 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -2453,15 +2453,18 @@ static XS (XS_weechat_api_hook_timer)
*/
int
-weechat_perl_api_hook_fd_cb (void *data)
+weechat_perl_api_hook_fd_cb (void *data, int fd)
{
struct t_script_callback *script_callback;
- char *perl_argv[1];
+ char *perl_argv[2], str_fd[32];
int *rc, ret;
script_callback = (struct t_script_callback *)data;
- perl_argv[0] = NULL;
+ snprintf (str_fd, sizeof (str_fd), "%d", fd);
+
+ perl_argv[0] = str_fd;
+ perl_argv[1] = NULL;
rc = (int *) weechat_perl_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,