Changeset ba9edaa for ipc.c


Ignore:
Timestamp:
2006-05-10T17:34:46Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
13cc96c
Parents:
67b6766
Message:

Moved everything to the BitlBee event handling API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r67b6766 rba9edaa  
    6060                ipc_to_children_str( "DIE\r\n" );
    6161       
    62         bitlbee_shutdown( NULL );
     62        bitlbee_shutdown( NULL, -1, 0 );
    6363}
    6464
     
    9191       
    9292        global.restart = -1;
    93         bitlbee_shutdown( NULL );
     93        bitlbee_shutdown( NULL, -1, 0 );
    9494}
    9595
     
    246246}
    247247
    248 void ipc_master_read( gpointer data, gint source, GaimInputCondition cond )
     248gboolean ipc_master_read( gpointer data, gint source, b_input_condition cond )
    249249{
    250250        char *buf, **cmd;
     
    272272                }
    273273        }
    274 }
    275 
    276 void ipc_child_read( gpointer data, gint source, GaimInputCondition cond )
     274       
     275        return TRUE;
     276}
     277
     278gboolean ipc_child_read( gpointer data, gint source, b_input_condition cond )
    277279{
    278280        char *buf, **cmd;
     
    286288        else
    287289        {
    288                 gaim_input_remove( global.listen_watch_source_id );
     290                b_event_remove( global.listen_watch_source_id );
    289291                close( global.listen_socket );
    290292               
    291293                global.listen_socket = -1;
    292294        }
     295       
     296        return TRUE;
    293297}
    294298
     
    397401void ipc_master_free_one( struct bitlbee_child *c )
    398402{
    399         gaim_input_remove( c->ipc_inpa );
     403        b_event_remove( c->ipc_inpa );
    400404        closesocket( c->ipc_fd );
    401405       
     
    463467
    464468
    465 static void new_ipc_client( gpointer data, gint serversock, GaimInputCondition cond )
     469static gboolean new_ipc_client( gpointer data, gint serversock, b_input_condition cond )
    466470{
    467471        struct bitlbee_child *child = g_new0( struct bitlbee_child, 1 );
     
    472476        {
    473477                log_message( LOGLVL_WARNING, "Unable to accept connection on UNIX domain socket: %s", strerror(errno) );
    474                 return;
    475         }
    476                
    477         child->ipc_inpa = gaim_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
     478                return TRUE;
     479        }
     480               
     481        child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
    478482       
    479483        child_list = g_slist_append( child_list, child );
     484       
     485        return TRUE;
    480486}
    481487
     
    512518        }
    513519       
    514         gaim_input_add( serversock, GAIM_INPUT_READ, new_ipc_client, NULL );
     520        b_input_add( serversock, GAIM_INPUT_READ, new_ipc_client, NULL );
    515521       
    516522        return 1;
     
    552558                        return 0;
    553559                }
    554                 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 );
    555561               
    556562                child_list = g_slist_append( child_list, child );
Note: See TracChangeset for help on using the changeset viewer.