Changeset 84a1a54 in mainline for uspace/app/nic/nic.c


Ignore:
Timestamp:
2018-01-04T20:47:53Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
facacc71
Parents:
cde999a
Message:

Wrap returns of errno from main() with EXIT_RC().

Returns of error code from main() prevent type checking when errno_t
and int are considered incompatible. In order to avoid the philosophical
discussion of what should and shouldn't be returned for main(), we simply
wrap the error values and leave the answer to the question for future
generations to decide.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nic/nic.c

    rcde999a r84a1a54  
    413413        async_sess_t *sess;
    414414        nic_address_t addr;
    415         int rc, idx;
     415        int rc;
     416        int idx;
    416417
    417418        sess = get_nic_by_index(i);
     
    543544
    544545                if (!str_cmp(argv[2], "addr"))
    545                         return nic_set_addr(index, argv[3]);
     546                        return EXIT_RC(nic_set_addr(index, argv[3]));
    546547
    547548                if (!str_cmp(argv[2], "speed"))
    548                         return nic_set_speed(index, argv[3]);
     549                        return EXIT_RC(nic_set_speed(index, argv[3]));
    549550
    550551                if (!str_cmp(argv[2], "duplex"))
    551                         return nic_set_duplex(index, argv[3]);
     552                        return EXIT_RC(nic_set_duplex(index, argv[3]));
    552553
    553554                if (!str_cmp(argv[2], "auto"))
    554                         return nic_set_autoneg(index);
     555                        return EXIT_RC(nic_set_autoneg(index));
    555556
    556557                if (!str_cmp(argv[2], "unicast"))
    557                         return nic_set_rx_unicast(index, argv[3]);
     558                        return EXIT_RC(nic_set_rx_unicast(index, argv[3]));
    558559
    559560                if (!str_cmp(argv[2], "multicast"))
    560                         return nic_set_rx_multicast(index, argv[3]);
     561                        return EXIT_RC(nic_set_rx_multicast(index, argv[3]));
    561562
    562563                if (!str_cmp(argv[2], "broadcast"))
    563                         return nic_set_rx_broadcast(index, argv[3]);
     564                        return EXIT_RC(nic_set_rx_broadcast(index, argv[3]));
    564565
    565566        } else {
Note: See TracChangeset for help on using the changeset viewer.