Ignore:
Timestamp:
2010-02-18T10:00:30Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e326edc
Parents:
b8da2a3 (diff), 91478aa (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 the networking branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/structures/packet/packet.c

    rb8da2a3 rca2d142  
    184184}
    185185
    186 packet_t pq_add( packet_t first, packet_t packet, size_t order, size_t metric ){
     186int pq_add( packet_t * first, packet_t packet, size_t order, size_t metric ){
    187187        packet_t        item;
    188188
    189         if( ! packet_is_valid( packet )) return NULL;
     189        if(( ! first ) || ( ! packet_is_valid( packet ))) return EINVAL;
    190190        pq_set_order( packet, order, metric );
    191         if( packet_is_valid( first )){
    192                 item = first;
     191        if( packet_is_valid( * first )){
     192                item = * first;
    193193                do{
    194194                        if( item->order < order ){
     
    198198                                        item->next = packet->packet_id;
    199199                                        packet->previous = item->packet_id;
    200                                         return first;
     200                                        return EOK;
    201201                                }
    202202                        }else{
     
    205205                                item->previous = packet->packet_id;
    206206                                item = pm_find( packet->previous );
    207                                 if( item ) item->next = packet->packet_id;
    208                                 return item ? first : packet;
     207                                if( item ){
     208                                        item->next = packet->packet_id;
     209                                }else{
     210                                        * first = packet;
     211                                }
     212                                return EOK;
    209213                        }
    210214                }while( packet_is_valid( item ));
    211215        }
    212         return packet;
     216        * first = packet;
     217        return EOK;
    213218}
    214219
Note: See TracChangeset for help on using the changeset viewer.