Changes in uspace/srv/ns/task.c [7b616e2:234f47e] in mainline
- File:
-
- 1 edited
-
uspace/srv/ns/task.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/ns/task.c
r7b616e2 r234f47e 32 32 */ 33 33 34 #include <ipc/ipc.h> 34 35 #include <adt/hash_table.h> 35 #include <async.h>36 36 #include <stdbool.h> 37 37 #include <errno.h> … … 182 182 continue; 183 183 184 texit = ht->have_rval ? TASK_EXIT_NORMAL : 185 TASK_EXIT_UNEXPECTED; 186 async_answer_2(pr->callid, EOK, texit, ht->retval); 184 if (!(pr->callid & IPC_CALLID_NOTIFICATION)) { 185 texit = ht->have_rval ? TASK_EXIT_NORMAL : 186 TASK_EXIT_UNEXPECTED; 187 ipc_answer_2(pr->callid, EOK, texit, 188 ht->retval); 189 } 187 190 188 191 list_remove(&pr->link); … … 200 203 if (ht == NULL) { 201 204 /* No such task exists. */ 202 async_answer_0(callid, ENOENT);205 ipc_answer_0(callid, ENOENT); 203 206 return; 204 207 } … … 207 210 task_exit_t texit = ht->have_rval ? TASK_EXIT_NORMAL : 208 211 TASK_EXIT_UNEXPECTED; 209 async_answer_2(callid, EOK, texit, ht->retval);212 ipc_answer_2(callid, EOK, texit, ht->retval); 210 213 return; 211 214 } … … 215 218 (pending_wait_t *) malloc(sizeof(pending_wait_t)); 216 219 if (!pr) { 217 async_answer_0(callid, ENOMEM); 220 if (!(callid & IPC_CALLID_NOTIFICATION)) 221 ipc_answer_0(callid, ENOMEM); 218 222 return; 219 223 } … … 278 282 int ns_task_retval(ipc_call_t *call) 279 283 { 280 task_id_t id = call->in_task_id;281 282 ht_link_t *link = hash_table_find(&task_hash_table, &id);283 hashed_task_t *ht = (link != NULL) ?284 hash_table_get_inst(link, hashed_task_t, link) : NULL;285 286 if ((ht == NULL) || (ht->finished))287 return EINVAL;288 289 ht->finished = true;290 ht->have_rval = true;291 ht->retval = IPC_GET_ARG1(*call);292 293 process_pending_wait();294 295 return EOK;296 }297 298 int ns_task_disconnect(ipc_call_t *call)299 {300 284 task_id_t id; 301 285 int rc = get_id_by_phone(call->in_phone_hash, &id); … … 303 287 return rc; 304 288 289 ht_link_t *link = hash_table_find(&task_hash_table, &id); 290 hashed_task_t *ht = (link != NULL) ? 291 hash_table_get_inst(link, hashed_task_t, link) : NULL; 292 293 if ((ht == NULL) || (ht->finished)) 294 return EINVAL; 295 296 ht->finished = true; 297 ht->have_rval = true; 298 ht->retval = IPC_GET_ARG1(*call); 299 300 process_pending_wait(); 301 302 return EOK; 303 } 304 305 int ns_task_disconnect(ipc_call_t *call) 306 { 307 task_id_t id; 308 int rc = get_id_by_phone(call->in_phone_hash, &id); 309 if (rc != EOK) 310 return rc; 311 305 312 /* Delete from phone-to-id map. */ 306 313 hash_table_remove(&phone_to_id, &call->in_phone_hash);
Note:
See TracChangeset
for help on using the changeset viewer.
