- Timestamp:
- 2006-06-21T16:34:33Z (18 years ago)
- Branches:
- master
- Children:
- 59f5c42a
- Parents:
- 3af70b0 (diff), df417ca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ipc.c
r3af70b0 rb72caac 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 … … 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.