diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-06-18 17:45:50 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-06-18 17:45:50 +0200 |
commit | 97c41c60a4b1f2b42f4f2df335ba2e2575e93b9a (patch) | |
tree | 564a5d03fb57311fe94b2e0326c679996c5ec220 /src | |
parent | de49e31965b0d0c8357a181335bc8210f1e69a45 (diff) | |
download | weechat-97c41c60a4b1f2b42f4f2df335ba2e2575e93b9a.zip |
Fix bug with fifo pipe when setting fifo option to "on"
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/fifo/fifo.c | 20 |
1 files changed, 8 insertions, 12 deletions
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); |