Changeset 763e0cd in mainline for uspace/srv/loc/loc.c
- Timestamp:
- 2011-08-18T14:25:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d0dd7b5, f55b12b
- Parents:
- 1dc4a5e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/loc/loc.c
r1dc4a5e r763e0cd 536 536 } 537 537 538 static void loc_category_get_name(ipc_callid_t iid, ipc_call_t *icall) 539 { 540 ipc_callid_t callid; 541 size_t size; 542 size_t act_size; 543 category_t *cat; 544 545 if (!async_data_read_receive(&callid, &size)) { 546 async_answer_0(callid, EREFUSED); 547 async_answer_0(iid, EREFUSED); 548 return; 549 } 550 551 fibril_mutex_lock(&cdir.mutex); 552 553 cat = category_get(&cdir, IPC_GET_ARG1(*icall)); 554 if (cat == NULL) { 555 fibril_mutex_unlock(&cdir.mutex); 556 async_answer_0(callid, ENOENT); 557 async_answer_0(iid, ENOENT); 558 return; 559 } 560 561 act_size = str_size(cat->name); 562 if (act_size > size) { 563 fibril_mutex_unlock(&cdir.mutex); 564 async_answer_0(callid, EOVERFLOW); 565 async_answer_0(iid, EOVERFLOW); 566 return; 567 } 568 569 sysarg_t retval = async_data_read_finalize(callid, cat->name, 570 min(size, act_size)); 571 572 fibril_mutex_unlock(&cdir.mutex); 573 574 async_answer_0(iid, retval); 575 } 576 538 577 static void loc_service_get_name(ipc_callid_t iid, ipc_call_t *icall) 539 578 { … … 574 613 async_answer_0(iid, retval); 575 614 } 576 577 615 578 616 /** Connect client to the service. … … 1298 1336 loc_category_get_id(callid, &call); 1299 1337 break; 1338 case LOC_CATEGORY_GET_NAME: 1339 loc_category_get_name(callid, &call); 1340 break; 1300 1341 case LOC_CATEGORY_GET_SVCS: 1301 1342 loc_category_get_svcs(callid, &call);
Note:
See TracChangeset
for help on using the changeset viewer.