Changeset 2e236901 in mainline for uspace/srv/net/netif/lo/lo.c


Ignore:
Timestamp:
2010-11-03T20:44:14Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
093c0a1
Parents:
b445803
Message:

Get rid of the ERROR_CODE madness in lo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/netif/lo/lo.c

    rb445803 r2e236901  
    3737#include <async.h>
    3838#include <errno.h>
    39 #include <err.h>
    4039#include <stdio.h>
    4140#include <str.h>
     
    8382int netif_get_device_stats(device_id_t device_id, device_stats_ref stats)
    8483{
    85         ERROR_DECLARE;
    86 
    8784        netif_device_t *device;
     85        int rc;
    8886
    8987        if (!stats)
    9088                return EBADMEM;
    91         ERROR_PROPAGATE(find_device(device_id, &device));
     89        rc = find_device(device_id, &device);
     90        if (rc != EOK)
     91                return rc;
    9292        memcpy(stats, (device_stats_ref) device->specific,
    9393            sizeof(device_stats_t));
     
    164164int netif_probe_message(device_id_t device_id, int irq, uintptr_t io)
    165165{
    166         ERROR_DECLARE;
    167 
    168166        netif_device_t *device;
     167        int rc;
    169168
    170169        // create a new device
    171         ERROR_PROPAGATE(create(device_id, &device));
     170        rc = create(device_id, &device);
     171        if (rc != EOK)
     172                return rc;
    172173        // print the settings
    173174        printf("%s: Device created (id: %d)\n", NAME, device->device_id);
     
    177178int netif_send_message(device_id_t device_id, packet_t packet, services_t sender)
    178179{
    179         ERROR_DECLARE;
    180 
    181180        netif_device_t *device;
    182181        size_t length;
    183182        packet_t next;
    184183        int phone;
    185 
    186         ERROR_PROPAGATE(find_device(device_id, &device));
     184        int rc;
     185
     186        rc = find_device(device_id, &device);
     187        if (rc != EOK)
     188                return EOK;
    187189        if (device->state != NETIF_ACTIVE) {
    188190                netif_pq_release(packet_get_id(packet));
     
    259261int main(int argc, char *argv[])
    260262{
    261         ERROR_DECLARE;
     263        int rc;
    262264       
    263265        /* Start the module */
    264         ERROR_PROPAGATE(netif_module_start(netif_client_connection));
    265         return EOK;
     266        rc = netif_module_start(netif_client_connection);
     267        return rc;
    266268}
    267269
Note: See TracChangeset for help on using the changeset viewer.