Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r3af70b0 rdfc8a46  
    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
     
    9999        { "die",        0, ipc_master_cmd_die,        0 },
    100100        { "wallops",    1, NULL,                      IPC_CMD_TO_CHILDREN },
    101         { "lilo",       1, NULL,                      IPC_CMD_TO_CHILDREN },
     101        { "wall",       1, NULL,                      IPC_CMD_TO_CHILDREN },
    102102        { "opermsg",    1, NULL,                      IPC_CMD_TO_CHILDREN },
    103103        { "rehash",     0, ipc_master_cmd_rehash,     0 },
     
    122122}
    123123
    124 static void ipc_child_cmd_lilo( irc_t *irc, char **cmd )
     124static void ipc_child_cmd_wall( irc_t *irc, char **cmd )
    125125{
    126126        if( !( irc->status & USTATUS_LOGGED_IN ) )
     
    175175        { "die",        0, ipc_child_cmd_die,         0 },
    176176        { "wallops",    1, ipc_child_cmd_wallops,     0 },
    177         { "lilo",       1, ipc_child_cmd_lilo,        0 },
     177        { "wall",       1, ipc_child_cmd_wall,        0 },
    178178        { "opermsg",    1, ipc_child_cmd_opermsg,     0 },
    179179        { "rehash",     0, ipc_child_cmd_rehash,      0 },
     
    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 gboolean new_ipc_client (GIOChannel *gio, GIOCondition cond, gpointer data)
     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 );
    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        {
    475477                log_message( LOGLVL_WARNING, "Unable to accept connection on UNIX domain socket: %s", strerror(errno) );
    476478                return TRUE;
    477479        }
    478480               
    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       
    481483        child_list = g_slist_append( child_list, child );
    482 
     484       
    483485        return TRUE;
    484486}
     
    489491        struct sockaddr_un un_addr;
    490492        int serversock;
    491         GIOChannel *gio;
    492493
    493494        /* Clean up old socket files that were hanging around.. */
     
    517518        }
    518519       
    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       
    527522        return 1;
    528523}
     
    563558                        return 0;
    564559                }
    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 );
    566561               
    567562                child_list = g_slist_append( child_list, child );
Note: See TracChangeset for help on using the changeset viewer.