Changeset 278ac72 in mainline for uspace/srv/loc/loc.c
- Timestamp:
- 2011-08-16T15:35:56Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30c78c0
- Parents:
- 16dc887
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/loc/loc.c
r16dc887 r278ac72 755 755 } 756 756 757 static void loc_get_categories(ipc_callid_t iid, ipc_call_t *icall) 758 { 759 ipc_callid_t callid; 760 size_t size; 761 size_t act_size; 762 int rc; 763 764 if (!async_data_read_receive(&callid, &size)) { 765 async_answer_0(callid, EREFUSED); 766 async_answer_0(iid, EREFUSED); 767 return; 768 } 769 770 category_id_t *id_buf = (category_id_t *) malloc(size); 771 if (id_buf == NULL) { 772 fibril_mutex_unlock(&cdir.mutex); 773 async_answer_0(callid, ENOMEM); 774 async_answer_0(iid, ENOMEM); 775 return; 776 } 777 778 fibril_mutex_lock(&cdir.mutex); 779 780 rc = categ_dir_get_categories(&cdir, id_buf, size, &act_size); 781 if (rc != EOK) { 782 fibril_mutex_unlock(&cdir.mutex); 783 async_answer_0(callid, rc); 784 async_answer_0(iid, rc); 785 return; 786 } 787 788 fibril_mutex_unlock(&cdir.mutex); 789 790 sysarg_t retval = async_data_read_finalize(callid, id_buf, size); 791 free(id_buf); 792 793 async_answer_1(iid, retval, act_size); 794 } 795 757 796 static void loc_get_namespaces(ipc_callid_t iid, ipc_call_t *icall) 758 797 { … … 1181 1220 case LOC_GET_SERVICE_COUNT: 1182 1221 loc_get_service_count(callid, &call); 1222 break; 1223 case LOC_GET_CATEGORIES: 1224 loc_get_categories(callid, &call); 1183 1225 break; 1184 1226 case LOC_GET_NAMESPACES:
Note:
See TracChangeset
for help on using the changeset viewer.