Ignore:
File:
1 edited

Legend:

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

    r0ab68f6 r84c20da  
    5454#include <ipc/services.h>
    5555#include <errno.h>
     56#include <err.h>
    5657
    5758DEVICE_MAP_IMPLEMENT(packet_dimensions, packet_dimension_t);
     
    123124    packet_dimension_ref *packet_dimension)
    124125{
    125         int rc;
     126        ERROR_DECLARE;
    126127       
    127128        if (!packet_dimension)
     
    136137                        return ENOMEM;
    137138               
    138                 rc = ip_packet_size_req(ip_phone, device_id, *packet_dimension);
    139                 if (rc != EOK) {
     139                if (ERROR_OCCURRED(ip_packet_size_req(ip_phone, device_id,
     140                    *packet_dimension))) {
    140141                        free(*packet_dimension);
    141                         return rc;
     142                        return ERROR_CODE;
    142143                }
    143144               
    144                 rc = packet_dimensions_add(packet_dimensions, device_id,
     145                ERROR_CODE = packet_dimensions_add(packet_dimensions, device_id,
    145146                    *packet_dimension);
    146                 if (rc < 0) {
     147                if (ERROR_CODE < 0) {
    147148                        free(*packet_dimension);
    148                         return rc;
     149                        return ERROR_CODE;
    149150                }
    150151        }
     
    291292    socklen_t addrlen)
    292293{
     294        ERROR_DECLARE;
     295
    293296        ipc_callid_t callid;
    294297        size_t length;
    295         void *data;
    296         int rc;
     298        void * data;
    297299
    298300        if (!dimension)
     
    317319
    318320        // read the data into the packet
    319         rc = async_data_write_finalize(callid, data, length);
    320         if (rc != EOK) {
     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))) {
    321325                pq_release_remote(packet_phone, packet_get_id(*packet));
    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;
     326                return ERROR_CODE;
    330327        }
    331328
Note: See TracChangeset for help on using the changeset viewer.