Changeset 0ab68f6 in mainline for uspace/lib/net/tl/tl_common.c
- Timestamp:
- 2010-11-07T20:48:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a5d238f
- Parents:
- 88b127b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/tl/tl_common.c
r88b127b r0ab68f6 54 54 #include <ipc/services.h> 55 55 #include <errno.h> 56 #include <err.h>57 56 58 57 DEVICE_MAP_IMPLEMENT(packet_dimensions, packet_dimension_t); … … 124 123 packet_dimension_ref *packet_dimension) 125 124 { 126 ERROR_DECLARE;125 int rc; 127 126 128 127 if (!packet_dimension) … … 137 136 return ENOMEM; 138 137 139 if (ERROR_OCCURRED(ip_packet_size_req(ip_phone, device_id,140 *packet_dimension))) {138 rc = ip_packet_size_req(ip_phone, device_id, *packet_dimension); 139 if (rc != EOK) { 141 140 free(*packet_dimension); 142 return ERROR_CODE;141 return rc; 143 142 } 144 143 145 ERROR_CODE= packet_dimensions_add(packet_dimensions, device_id,144 rc = packet_dimensions_add(packet_dimensions, device_id, 146 145 *packet_dimension); 147 if ( ERROR_CODE< 0) {146 if (rc < 0) { 148 147 free(*packet_dimension); 149 return ERROR_CODE;148 return rc; 150 149 } 151 150 } … … 292 291 socklen_t addrlen) 293 292 { 294 ERROR_DECLARE;295 296 293 ipc_callid_t callid; 297 294 size_t length; 298 void * data; 295 void *data; 296 int rc; 299 297 300 298 if (!dimension) … … 319 317 320 318 // read the data into the packet 321 if (ERROR_OCCURRED(async_data_write_finalize(callid, data, length)) || 322 // set the packet destination address 323 ERROR_OCCURRED(packet_set_addr(*packet, NULL, (uint8_t *) addr, 324 addrlen))) { 319 rc = async_data_write_finalize(callid, data, length); 320 if (rc != EOK) { 325 321 pq_release_remote(packet_phone, packet_get_id(*packet)); 326 return ERROR_CODE; 322 return rc; 323 } 324 325 // set the packet destination address 326 rc = packet_set_addr(*packet, NULL, (uint8_t *) addr, addrlen); 327 if (rc != EOK) { 328 pq_release_remote(packet_phone, packet_get_id(*packet)); 329 return rc; 327 330 } 328 331
Note:
See TracChangeset
for help on using the changeset viewer.