From 97c41c60a4b1f2b42f4f2df335ba2e2575e93b9a Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 18 Jun 2010 17:45:50 +0200 Subject: Fix bug with fifo pipe when setting fifo option to "on" --- src/plugins/fifo/fifo.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c index 6b3890305..474497a49 100644 --- a/src/plugins/fifo/fifo.c +++ b/src/plugins/fifo/fifo.c @@ -58,6 +58,9 @@ char *fifo_filename; char *fifo_unterminated = NULL; +int fifo_read(); + + /* * fifo_remove_old_pipes: remove old fifo pipes in directory */ @@ -111,18 +114,14 @@ fifo_remove_old_pipes () /* * fifo_create: create FIFO pipe for remote control - * return: 1 if ok - * 0 if error */ -int +void fifo_create () { - int rc, filename_length; + int filename_length; const char *fifo_option, *weechat_home; - rc = 0; - fifo_option = weechat_config_get_plugin ("fifo"); if (!fifo_option) { @@ -166,7 +165,8 @@ fifo_create () _("%s: pipe opened"), FIFO_PLUGIN_NAME); } - rc = 1; + fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0, + &fifo_read, NULL); } else weechat_printf (NULL, @@ -183,8 +183,6 @@ fifo_create () fifo_filename); } } - - return rc; } /* @@ -438,9 +436,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) fifo_quiet = 1; - if (fifo_create ()) - fifo_fd_hook = weechat_hook_fd (fifo_fd, 1, 0, 0, - &fifo_read, NULL); + fifo_create (); weechat_hook_config ("plugins.var.fifo.fifo", &fifo_config_cb, NULL); -- cgit v1.2.3