Changeset 007e6efa in mainline for uspace/srv/loader/main.c


Ignore:
Timestamp:
2011-01-28T15:44:39Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4db1fbf
Parents:
ae0300b5
Message:
  • libc routines for registering services and connecting to services via NS
  • async_connect_to_me()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/loader/main.c

    rae0300b5 r007e6efa  
    9595
    9696/** Used to limit number of connections to one. */
    97 static bool connected;
     97static bool connected = false;
    9898
    9999static void ldr_get_taskid(ipc_callid_t rid, ipc_call_t *request)
     
    423423int main(int argc, char *argv[])
    424424{
    425         task_id_t id;
    426         int rc;
    427 
    428         connected = false;
    429 
     425        /* Set a handler of incomming connections. */
     426        async_set_client_connection(ldr_connection);
     427       
    430428        /* Introduce this task to the NS (give it our task ID). */
    431         id = task_get_id();
    432         rc = async_req_2_0(PHONE_NS, NS_ID_INTRO, LOWER32(id), UPPER32(id));
     429        task_id_t id = task_get_id();
     430        int rc = async_req_2_0(PHONE_NS, NS_ID_INTRO, LOWER32(id), UPPER32(id));
    433431        if (rc != EOK)
    434432                return -1;
    435 
    436         /* Set a handler of incomming connections. */
    437         async_set_client_connection(ldr_connection);
    438433       
    439434        /* Register at naming service. */
    440         if (ipc_connect_to_me(PHONE_NS, SERVICE_LOAD, 0, 0, NULL, NULL) != 0)
     435        if (service_register(SERVICE_LOAD) != EOK)
    441436                return -2;
    442 
     437       
    443438        async_manager();
    444439       
Note: See TracChangeset for help on using the changeset viewer.