Changeset b7fd2a0 in mainline for uspace/srv/net/dnsrsrv/dnsrsrv.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (6 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/dnsrsrv/dnsrsrv.c

    r36f0738 rb7fd2a0  
    5454static void dnsr_client_conn(ipc_callid_t, ipc_call_t *, void *);
    5555
    56 static int dnsr_init(void)
    57 {
    58         int rc;
     56static errno_t dnsr_init(void)
     57{
     58        errno_t rc;
    5959        log_msg(LOG_DEFAULT, LVL_DEBUG, "dnsr_init()");
    6060
     
    9393       
    9494        char *name;
    95         int rc = async_data_write_accept((void **) &name, true, 0,
     95        errno_t rc = async_data_write_accept((void **) &name, true, 0,
    9696            DNS_NAME_MAX_SIZE, 0, NULL);
    9797        if (rc != EOK) {
     
    171171        // FIXME locking
    172172       
    173         int rc = async_data_read_finalize(callid, &dns_server_addr, size);
     173        errno_t rc = async_data_read_finalize(callid, &dns_server_addr, size);
    174174        if (rc != EOK)
    175175                async_answer_0(callid, rc);
     
    199199        // FIXME locking
    200200       
    201         int rc = async_data_write_finalize(callid, &dns_server_addr, size);
     201        errno_t rc = async_data_write_finalize(callid, &dns_server_addr, size);
    202202        if (rc != EOK) {
    203203                async_answer_0(callid, rc);
     
    246246int main(int argc, char *argv[])
    247247{
    248         int rc;
     248        errno_t rc;
    249249
    250250        printf("%s: DNS Resolution Service\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.