Changeset 46577995 in mainline for uspace/app/nic


Ignore:
Timestamp:
2018-01-04T20:50:52Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

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

    rfacacc71 r46577995  
    7272static async_sess_t *get_nic_by_index(size_t i)
    7373{
    74         int rc;
     74        errno_t rc;
    7575        size_t count;
    7676        char *svc_name;
     
    110110}
    111111
    112 static int nic_get_info(service_id_t svc_id, char *svc_name,
     112static errno_t nic_get_info(service_id_t svc_id, char *svc_name,
    113113    nic_info_t *info)
    114114{
    115115        async_sess_t *sess;
    116116        nic_role_t role;
    117         int rc;
     117        errno_t rc;
    118118
    119119        sess = loc_service_connect(svc_id, INTERFACE_DDF, 0);
     
    245245}
    246246
    247 static int nic_list(void)
     247static errno_t nic_list(void)
    248248{
    249249        category_id_t nic_cat;
     
    253253        char *svc_name;
    254254        char *addr_str;
    255         int rc;
     255        errno_t rc;
    256256
    257257        rc = loc_category_get_id("nic", &nic_cat, 0);
     
    316316}
    317317
    318 static int nic_set_speed(int i, char *str)
     318static errno_t nic_set_speed(int i, char *str)
    319319{
    320320        async_sess_t *sess;
     
    323323        nic_channel_mode_t oldduplex;
    324324        nic_role_t oldrole;
    325         int rc;
     325        errno_t rc;
    326326
    327327        rc = str_uint32_t(str, NULL, 10, false, &speed);
     
    351351}
    352352
    353 static int nic_set_duplex(int i, char *str)
     353static errno_t nic_set_duplex(int i, char *str)
    354354{
    355355        async_sess_t *sess;
     
    358358        nic_channel_mode_t oldduplex;
    359359        nic_role_t oldrole;
    360         int rc;
     360        errno_t rc;
    361361
    362362        if (!str_cmp(str, "half"))
     
    389389}
    390390
    391 static int nic_set_autoneg(int i)
    392 {
    393         async_sess_t *sess;
    394         int rc;
     391static errno_t nic_set_autoneg(int i)
     392{
     393        async_sess_t *sess;
     394        errno_t rc;
    395395
    396396        sess = get_nic_by_index(i);
     
    409409}
    410410
    411 static int nic_set_addr(int i, char *str)
     411static errno_t nic_set_addr(int i, char *str)
    412412{
    413413        async_sess_t *sess;
    414414        nic_address_t addr;
    415         int rc;
     415        errno_t rc;
    416416        int idx;
    417417
     
    438438}
    439439
    440 static int nic_set_rx_unicast(int i, char *str)
     440static errno_t nic_set_rx_unicast(int i, char *str)
    441441{
    442442        async_sess_t *sess;
     
    473473}
    474474
    475 static int nic_set_rx_multicast(int i, char *str)
     475static errno_t nic_set_rx_multicast(int i, char *str)
    476476{
    477477        async_sess_t *sess;
     
    502502}
    503503
    504 static int nic_set_rx_broadcast(int i, char *str)
     504static errno_t nic_set_rx_broadcast(int i, char *str)
    505505{
    506506        async_sess_t *sess;
     
    528528int main(int argc, char *argv[])
    529529{
    530         int rc;
     530        errno_t rc;
    531531        uint32_t index;
    532532
Note: See TracChangeset for help on using the changeset viewer.