Changeset 7b616e2 in mainline for uspace/srv/ns/clonable.c


Ignore:
Timestamp:
2017-09-27T22:40:09Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d076f16
Parents:
8d6bcc8c
Message:

Name service should communicate using async.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ns/clonable.c

    r8d6bcc8c r7b616e2  
    3131 */
    3232
    33 #include <ipc/ipc.h>
     33#include <async.h>
    3434#include <ipc/services.h>
    3535#include <adt/list.h>
     
    8181                /* There was no pending connection request. */
    8282                printf("%s: Unexpected clonable server.\n", NAME);
    83                 ipc_answer_0(callid, EBUSY);
     83                async_answer_0(callid, EBUSY);
    8484                return;
    8585        }
     
    9191        assert(csr->service == SERVICE_LOADER);
    9292       
    93         ipc_answer_0(callid, EOK);
     93        async_answer_0(callid, EOK);
    9494       
    95         ipc_forward_fast(csr->callid, phone, csr->iface, csr->arg3, 0,
     95        async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE);
     96        if (sess == NULL)
     97                async_answer_0(callid, EIO);
     98       
     99        async_exch_t *exch = async_exchange_begin(sess);
     100        async_forward_fast(csr->callid, exch, csr->iface, csr->arg3, 0,
    96101            IPC_FF_NONE);
     102        async_exchange_end(exch);
    97103       
    98104        free(csr);
    99         ipc_hangup(phone);
     105        async_hangup(sess);
    100106}
    101107
     
    117123        cs_req_t *csr = malloc(sizeof(cs_req_t));
    118124        if (csr == NULL) {
    119                 ipc_answer_0(callid, ENOMEM);
     125                async_answer_0(callid, ENOMEM);
    120126                return;
    121127        }
     
    126132        if (rc < 0) {
    127133                free(csr);
    128                 ipc_answer_0(callid, rc);
     134                async_answer_0(callid, rc);
    129135                return;
    130136        }
Note: See TracChangeset for help on using the changeset viewer.