Changeset 3090715 in mainline for uspace/lib/net/tl/tl_common.c


Ignore:
Timestamp:
2010-11-07T21:16:56Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1d0d06a
Parents:
9ce7eb5 (diff), 9ee9d5d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jakub/helenos/net/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/tl/tl_common.c

    r9ce7eb5 r3090715  
    5454#include <ipc/services.h>
    5555#include <errno.h>
    56 #include <err.h>
    5756
    5857DEVICE_MAP_IMPLEMENT(packet_dimensions, packet_dimension_t);
     
    124123    packet_dimension_ref *packet_dimension)
    125124{
    126         ERROR_DECLARE;
     125        int rc;
    127126       
    128127        if (!packet_dimension)
     
    137136                        return ENOMEM;
    138137               
    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) {
    141140                        free(*packet_dimension);
    142                         return ERROR_CODE;
     141                        return rc;
    143142                }
    144143               
    145                 ERROR_CODE = packet_dimensions_add(packet_dimensions, device_id,
     144                rc = packet_dimensions_add(packet_dimensions, device_id,
    146145                    *packet_dimension);
    147                 if (ERROR_CODE < 0) {
     146                if (rc < 0) {
    148147                        free(*packet_dimension);
    149                         return ERROR_CODE;
     148                        return rc;
    150149                }
    151150        }
     
    292291    socklen_t addrlen)
    293292{
    294         ERROR_DECLARE;
    295 
    296293        ipc_callid_t callid;
    297294        size_t length;
    298         void * data;
     295        void *data;
     296        int rc;
    299297
    300298        if (!dimension)
     
    319317
    320318        // 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) {
    325321                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;
    327330        }
    328331
Note: See TracChangeset for help on using the changeset viewer.