Changeset b7fd2a0 in mainline for uspace/srv/net/inetsrv/ndp.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
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.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/ndp.c

    r36f0738 rb7fd2a0  
    6464}
    6565
    66 static int ndp_send_packet(inet_link_t *link, ndp_packet_t *packet)
     66static errno_t ndp_send_packet(inet_link_t *link, ndp_packet_t *packet)
    6767{
    6868        inet_dgram_t dgram;
     
    7777}
    7878
    79 static int ndp_router_advertisement(inet_dgram_t *dgram, inet_addr_t *router)
     79static errno_t ndp_router_advertisement(inet_dgram_t *dgram, inet_addr_t *router)
    8080{
    8181        // FIXME TODO
     
    8383}
    8484
    85 int ndp_received(inet_dgram_t *dgram)
     85errno_t ndp_received(inet_dgram_t *dgram)
    8686{
    8787        log_msg(LOG_DEFAULT, LVL_DEBUG, "ndp_received()");
    8888       
    8989        ndp_packet_t packet;
    90         int rc = ndp_pdu_decode(dgram, &packet);
     90        errno_t rc = ndp_pdu_decode(dgram, &packet);
    9191        if (rc != EOK)
    9292                return rc;
     
    151151 *
    152152 */
    153 int ndp_translate(addr128_t src_addr, addr128_t ip_addr, addr48_t mac_addr,
     153errno_t ndp_translate(addr128_t src_addr, addr128_t ip_addr, addr48_t mac_addr,
    154154    inet_link_t *ilink)
    155155{
     
    160160        }
    161161       
    162         int rc = ntrans_lookup(ip_addr, mac_addr);
     162        errno_t rc = ntrans_lookup(ip_addr, mac_addr);
    163163        if (rc == EOK)
    164164                return EOK;
Note: See TracChangeset for help on using the changeset viewer.