From 4d1fdfade0cfb51e9ff680861e3333bd2b24173a Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 18 Feb 2009 11:13:23 +0100 Subject: Give file descriptor to callback of hook_fd --- src/plugins/scripts/python/weechat-python-api.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/plugins/scripts/python') diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index fe77270b4..9cf06796b 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -2613,15 +2613,18 @@ weechat_python_api_hook_timer (PyObject *self, PyObject *args) */ int -weechat_python_api_hook_fd_cb (void *data) +weechat_python_api_hook_fd_cb (void *data, int fd) { struct t_script_callback *script_callback; - char *python_argv[1]; + char *python_argv[2], str_fd[32]; int *rc, ret; script_callback = (struct t_script_callback *)data; - python_argv[0] = NULL; + snprintf (str_fd, sizeof (str_fd), "%d", fd); + + python_argv[0] = str_fd; + python_argv[1] = NULL; rc = (int *) weechat_python_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, -- cgit v1.2.3