Changeset 45058baa in mainline
- Timestamp:
- 2011-08-16T17:53:09Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 12f9f0d0, db6e419
- Parents:
- cce8a83
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/loc.c
rcce8a83 r45058baa 304 304 async_exch_t *exch; 305 305 char name_buf[LOC_NAME_MAXLEN + 1]; 306 ipc_call_t dreply; 307 size_t act_size; 308 sysarg_t dretval; 306 309 307 310 *name = NULL; 308 memset(name_buf, 0, LOC_NAME_MAXLEN + 1);309 311 exch = loc_exchange_begin_blocking(LOC_PORT_CONSUMER); 310 312 311 313 ipc_call_t answer; 312 314 aid_t req = async_send_1(exch, LOC_SERVICE_GET_NAME, svc_id, &answer); 313 int rc = async_data_read_start(exch, name_buf, LOC_NAME_MAXLEN); 314 315 loc_exchange_end(exch); 316 317 if (rc != EOK) { 315 aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, 316 &dreply); 317 async_wait_for(dreq, &dretval); 318 319 loc_exchange_end(exch); 320 321 if (dretval != EOK) { 318 322 async_wait_for(req, NULL); 319 return rc;323 return dretval; 320 324 } 321 325 … … 326 330 return retval; 327 331 332 act_size = IPC_GET_ARG2(dreply); 333 assert(act_size <= LOC_NAME_MAXLEN); 334 name_buf[act_size] = '\0'; 335 328 336 *name = str_dup(name_buf); 329 337 if (*name == NULL)
Note:
See TracChangeset
for help on using the changeset viewer.