Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e6e5f4e in mainline


Ignore:
Timestamp:
2013-03-24T16:35:07Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
6ec1d48
Parents:
2ba4d45
Message:

libhound: Fix context registration.

Location:
uspace/lib/hound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/include/hound/protocol.h

    r2ba4d45 re6e5f4e  
    105105} hound_server_iface_t;
    106106
    107 void hound_service_set_server_iface(hound_server_iface_t *iface);
     107void hound_service_set_server_iface(const hound_server_iface_t *iface);
    108108
    109109void hound_connection_handler(ipc_callid_t iid, ipc_call_t *icall, void *arg);
  • uspace/lib/hound/src/protocol.c

    r2ba4d45 re6e5f4e  
    8484        assert(sess);
    8585        assert(name);
     86        ipc_call_t call;
    8687        async_exch_t *exch = async_exchange_begin(sess);
    87         sysarg_t id;
    88         int ret =
    89             async_req_1_1(exch, IPC_M_HOUND_CONTEXT_REGISTER, record, &id);
     88        aid_t mid =
     89            async_send_1(exch, IPC_M_HOUND_CONTEXT_REGISTER, record, &call);
     90        int ret = mid ? EOK : EPARTY;
     91
    9092        if (ret == EOK)
    9193                ret = async_data_write_start(exch, name, str_size(name));
     94        else
     95                async_forget(mid);
     96
     97        if (ret == EOK)
     98                async_wait_for(mid, (sysarg_t *)&ret);
     99
    92100        async_exchange_end(exch);
    93         return ret == EOK ? (hound_context_id_t)id : ret;
     101        return ret == EOK ? (hound_context_id_t)IPC_GET_ARG1(call) : ret;
    94102}
    95103
     
    244252static const hound_server_iface_t *server_iface;
    245253
    246 void hound_service_set_server_iface(hound_server_iface_t *iface)
     254void hound_service_set_server_iface(const hound_server_iface_t *iface)
    247255{
    248256        server_iface = iface;
     
    282290                                free(name);
    283291                                async_answer_0(callid, ret);
    284                                 break;
    285                         }
    286                         async_answer_1(callid, EOK, id);
     292                        } else {
     293                                async_answer_1(callid, EOK, id);
     294                        }
     295                        break;
    287296                }
    288297                case IPC_M_HOUND_CONTEXT_UNREGISTER: {
Note: See TracChangeset for help on using the changeset viewer.