From 6f6725c5bbec31d1b9f6937f229f140828e50e45 Mon Sep 17 00:00:00 2001 From: dequis Date: Wed, 26 Nov 2014 02:25:00 -0300 Subject: Use irc_write_all() to send the message in bitlbee_shutdown This ensures that the message arrives by using the "now" parameter of irc_write_all(), because in my testing it didn't show up (even though surrounding it with printf() worked, in inetd mode) --- bitlbee.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bitlbee.c') diff --git a/bitlbee.c b/bitlbee.c index 93754d05..ca783cf6 100644 --- a/bitlbee.c +++ b/bitlbee.c @@ -361,10 +361,12 @@ static gboolean bitlbee_io_new_client( gpointer data, gint fd, b_input_condition gboolean bitlbee_shutdown( gpointer data, gint fd, b_input_condition cond ) { + /* Send the message here with now=TRUE to ensure it arrives */ + irc_write_all( TRUE, "ERROR :Closing link: BitlBee server shutting down" ); + /* Try to save data for all active connections (if desired). */ while( irc_connection_list != NULL ) - irc_abort( irc_connection_list->data, TRUE, - "BitlBee server shutting down" ); + irc_abort( irc_connection_list->data, TRUE, NULL ); /* We'll only reach this point when not running in inetd mode: */ b_main_quit(); -- cgit v1.2.3