summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua/weechat-lua-api.c
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/lua/weechat-lua-api.c
parente263a847da839253e346fa3843aaf7cb90199f01 (diff)
downloadweechat-4d1fdfade0cfb51e9ff680861e3333bd2b24173a.zip
Give file descriptor to callback of hook_fd
Diffstat (limited to 'src/plugins/scripts/lua/weechat-lua-api.c')
-rw-r--r--src/plugins/scripts/lua/weechat-lua-api.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c
index 88733610c..503f2f10f 100644
--- a/src/plugins/scripts/lua/weechat-lua-api.c
+++ b/src/plugins/scripts/lua/weechat-lua-api.c
@@ -2940,15 +2940,18 @@ weechat_lua_api_hook_timer (lua_State *L)
*/
int
-weechat_lua_api_hook_fd_cb (void *data)
+weechat_lua_api_hook_fd_cb (void *data, int fd)
{
struct t_script_callback *script_callback;
- char *lua_argv[1];
+ char *lua_argv[2], str_fd[32];
int *rc, ret;
script_callback = (struct t_script_callback *)data;
- lua_argv[0] = NULL;
+ snprintf (str_fd, sizeof (str_fd), "%d", fd);
+
+ lua_argv[0] = str_fd;
+ lua_argv[1] = NULL;
rc = (int *) weechat_lua_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,