Changes in ipc.c [3af70b0:dfc8a46]
Legend:
- Unmodified
- Added
- Removed
-
ipc.c
r3af70b0 rdfc8a46 60 60 ipc_to_children_str( "DIE\r\n" ); 61 61 62 bitlbee_shutdown( NULL );62 bitlbee_shutdown( NULL, -1, 0 ); 63 63 } 64 64 … … 91 91 92 92 global.restart = -1; 93 bitlbee_shutdown( NULL );93 bitlbee_shutdown( NULL, -1, 0 ); 94 94 } 95 95 … … 99 99 { "die", 0, ipc_master_cmd_die, 0 }, 100 100 { "wallops", 1, NULL, IPC_CMD_TO_CHILDREN }, 101 { " lilo", 1, NULL, IPC_CMD_TO_CHILDREN },101 { "wall", 1, NULL, IPC_CMD_TO_CHILDREN }, 102 102 { "opermsg", 1, NULL, IPC_CMD_TO_CHILDREN }, 103 103 { "rehash", 0, ipc_master_cmd_rehash, 0 }, … … 122 122 } 123 123 124 static void ipc_child_cmd_ lilo( irc_t *irc, char **cmd )124 static void ipc_child_cmd_wall( irc_t *irc, char **cmd ) 125 125 { 126 126 if( !( irc->status & USTATUS_LOGGED_IN ) ) … … 175 175 { "die", 0, ipc_child_cmd_die, 0 }, 176 176 { "wallops", 1, ipc_child_cmd_wallops, 0 }, 177 { " lilo", 1, ipc_child_cmd_lilo, 0 },177 { "wall", 1, ipc_child_cmd_wall, 0 }, 178 178 { "opermsg", 1, ipc_child_cmd_opermsg, 0 }, 179 179 { "rehash", 0, ipc_child_cmd_rehash, 0 }, … … 246 246 } 247 247 248 void ipc_master_read( gpointer data, gint source, GaimInputCondition cond )248 gboolean ipc_master_read( gpointer data, gint source, b_input_condition cond ) 249 249 { 250 250 char *buf, **cmd; … … 272 272 } 273 273 } 274 } 275 276 void ipc_child_read( gpointer data, gint source, GaimInputCondition cond ) 274 275 return TRUE; 276 } 277 278 gboolean ipc_child_read( gpointer data, gint source, b_input_condition cond ) 277 279 { 278 280 char *buf, **cmd; … … 286 288 else 287 289 { 288 gaim_input_remove( global.listen_watch_source_id );290 b_event_remove( global.listen_watch_source_id ); 289 291 close( global.listen_socket ); 290 292 291 293 global.listen_socket = -1; 292 294 } 295 296 return TRUE; 293 297 } 294 298 … … 397 401 void ipc_master_free_one( struct bitlbee_child *c ) 398 402 { 399 gaim_input_remove( c->ipc_inpa );403 b_event_remove( c->ipc_inpa ); 400 404 closesocket( c->ipc_fd ); 401 405 … … 463 467 464 468 465 static gboolean new_ipc_client (GIOChannel *gio, GIOCondition cond, gpointer data)469 static gboolean new_ipc_client( gpointer data, gint serversock, b_input_condition cond ) 466 470 { 467 471 struct bitlbee_child *child = g_new0( struct bitlbee_child, 1 ); 468 int serversock; 469 470 serversock = g_io_channel_unix_get_fd(gio); 471 472 child->ipc_fd = accept(serversock, NULL, 0); 473 474 if (child->ipc_fd == -1) { 472 473 child->ipc_fd = accept( serversock, NULL, 0 ); 474 475 if( child->ipc_fd == -1 ) 476 { 475 477 log_message( LOGLVL_WARNING, "Unable to accept connection on UNIX domain socket: %s", strerror(errno) ); 476 478 return TRUE; 477 479 } 478 480 479 child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );480 481 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 482 481 483 child_list = g_slist_append( child_list, child ); 482 484 483 485 return TRUE; 484 486 } … … 489 491 struct sockaddr_un un_addr; 490 492 int serversock; 491 GIOChannel *gio;492 493 493 494 /* Clean up old socket files that were hanging around.. */ … … 517 518 } 518 519 519 gio = g_io_channel_unix_new(serversock); 520 521 if (gio == NULL) { 522 log_message( LOGLVL_WARNING, "Unable to create IO channel for unix socket" ); 523 return 0; 524 } 525 526 g_io_add_watch(gio, G_IO_IN, new_ipc_client, NULL); 520 b_input_add( serversock, GAIM_INPUT_READ, new_ipc_client, NULL ); 521 527 522 return 1; 528 523 } … … 563 558 return 0; 564 559 } 565 child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );560 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 566 561 567 562 child_list = g_slist_append( child_list, child );
Note: See TracChangeset
for help on using the changeset viewer.