Changes in ipc.c [ba9edaa:dd89a55]
Legend:
- Unmodified
- Added
- Removed
-
ipc.c
rba9edaa rdd89a55 60 60 ipc_to_children_str( "DIE\r\n" ); 61 61 62 bitlbee_shutdown( NULL , -1, 0);62 bitlbee_shutdown( NULL ); 63 63 } 64 64 … … 91 91 92 92 global.restart = -1; 93 bitlbee_shutdown( NULL , -1, 0);93 bitlbee_shutdown( NULL ); 94 94 } 95 95 … … 246 246 } 247 247 248 gboolean ipc_master_read( gpointer data, gint source, b_input_condition cond )248 void ipc_master_read( gpointer data, gint source, GaimInputCondition cond ) 249 249 { 250 250 char *buf, **cmd; … … 272 272 } 273 273 } 274 275 return TRUE; 276 } 277 278 gboolean ipc_child_read( gpointer data, gint source, b_input_condition cond ) 274 } 275 276 void ipc_child_read( gpointer data, gint source, GaimInputCondition cond ) 279 277 { 280 278 char *buf, **cmd; … … 288 286 else 289 287 { 290 b_event_remove( global.listen_watch_source_id );288 gaim_input_remove( global.listen_watch_source_id ); 291 289 close( global.listen_socket ); 292 290 293 291 global.listen_socket = -1; 294 292 } 295 296 return TRUE;297 293 } 298 294 … … 401 397 void ipc_master_free_one( struct bitlbee_child *c ) 402 398 { 403 b_event_remove( c->ipc_inpa );399 gaim_input_remove( c->ipc_inpa ); 404 400 closesocket( c->ipc_fd ); 405 401 … … 467 463 468 464 469 static gboolean new_ipc_client ( gpointer data, gint serversock, b_input_condition cond)465 static gboolean new_ipc_client (GIOChannel *gio, GIOCondition cond, gpointer data) 470 466 { 471 467 struct bitlbee_child *child = g_new0( struct bitlbee_child, 1 ); 472 473 child->ipc_fd = accept( serversock, NULL, 0 ); 474 475 if( child->ipc_fd == -1 ) 476 { 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) { 477 475 log_message( LOGLVL_WARNING, "Unable to accept connection on UNIX domain socket: %s", strerror(errno) ); 478 476 return TRUE; 479 477 } 480 478 481 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );482 479 child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 480 483 481 child_list = g_slist_append( child_list, child ); 484 482 485 483 return TRUE; 486 484 } … … 491 489 struct sockaddr_un un_addr; 492 490 int serversock; 491 GIOChannel *gio; 493 492 494 493 /* Clean up old socket files that were hanging around.. */ … … 508 507 } 509 508 510 if (bind(serversock, &un_addr, sizeof(un_addr)) == -1) {509 if (bind(serversock, (struct sockaddr *)&un_addr, sizeof(un_addr)) == -1) { 511 510 log_message( LOGLVL_WARNING, "Unable to bind UNIX socket to %s: %s", IPCSOCKET, strerror(errno) ); 512 511 return 0; … … 518 517 } 519 518 520 b_input_add( serversock, GAIM_INPUT_READ, new_ipc_client, NULL ); 521 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); 522 527 return 1; 523 528 } … … 558 563 return 0; 559 564 } 560 child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );565 child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child ); 561 566 562 567 child_list = g_slist_append( child_list, child ); … … 566 571 ipc_to_children_str( "OPERMSG :New BitlBee master process started (version " BITLBEE_VERSION ")\r\n" ); 567 572 573 fclose( fp ); 568 574 return 1; 569 575 }
Note: See TracChangeset
for help on using the changeset viewer.