Changeset a35b458 in mainline for uspace/srv/ns/service.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/service.c
r3061bc1 ra35b458 43 43 typedef struct { 44 44 ht_link_t link; 45 45 46 46 /** Service ID */ 47 47 service_t service; 48 48 49 49 /** Session to the service */ 50 50 async_sess_t *sess; … … 60 60 hashed_service_t *service = 61 61 hash_table_get_inst(item, hashed_service_t, link); 62 62 63 63 return service->service; 64 64 } … … 68 68 hashed_service_t *service = 69 69 hash_table_get_inst(item, hashed_service_t, link); 70 70 71 71 return service->service == *(service_t *) key; 72 72 } … … 102 102 return ENOMEM; 103 103 } 104 104 105 105 list_initialize(&pending_conn); 106 106 107 107 return EOK; 108 108 } … … 116 116 if (!link) 117 117 continue; 118 118 119 119 hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link); 120 120 async_exch_t *exch = async_exchange_begin(hashed_service->sess); … … 122 122 pending->arg3, 0, IPC_FF_NONE); 123 123 async_exchange_end(exch); 124 124 125 125 list_remove(&pending->link); 126 126 free(pending); 127 127 128 128 goto loop; 129 129 } … … 143 143 if (hash_table_find(&service_hash_table, &service)) 144 144 return EEXIST; 145 145 146 146 hashed_service_t *hashed_service = 147 147 (hashed_service_t *) malloc(sizeof(hashed_service_t)); 148 148 if (!hashed_service) 149 149 return ENOMEM; 150 150 151 151 hashed_service->service = service; 152 152 hashed_service->sess = async_callback_receive(EXCHANGE_SERIALIZE); 153 153 if (hashed_service->sess == NULL) 154 154 return EIO; 155 155 156 156 hash_table_insert(&service_hash_table, &hashed_service->link); 157 157 return EOK; … … 174 174 sysarg_t flags = IPC_GET_ARG4(*call); 175 175 errno_t retval; 176 176 177 177 ht_link_t *link = hash_table_find(&service_hash_table, &service); 178 178 if (!link) { … … 185 185 goto out; 186 186 } 187 187 188 188 link_initialize(&pending->link); 189 189 pending->service = service; … … 191 191 pending->callid = callid; 192 192 pending->arg3 = arg3; 193 193 194 194 list_append(&pending->link, &pending_conn); 195 195 return; 196 196 } 197 197 198 198 retval = ENOENT; 199 199 goto out; 200 200 } 201 201 202 202 hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link); 203 203 async_exch_t *exch = async_exchange_begin(hashed_service->sess); … … 205 205 async_exchange_end(exch); 206 206 return; 207 207 208 208 out: 209 209 async_answer_0(callid, retval);
Note:
See TracChangeset
for help on using the changeset viewer.