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


Ignore:
Timestamp:
2018-03-02T20:10:49Z (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:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/dnsrsrv/dnsrsrv.c

    r3061bc1 ra35b458  
    9090{
    9191        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srvaddr_srv()");
    92        
     92
    9393        ip_ver_t ver = IPC_GET_ARG1(*icall);
    94        
     94
    9595        char *name;
    9696        errno_t rc = async_data_write_accept((void **) &name, true, 0,
     
    100100                return;
    101101        }
    102        
     102
    103103        dns_host_info_t *hinfo;
    104104        rc = dns_name2host(name, &hinfo, ver);
     
    107107                return;
    108108        }
    109        
     109
    110110        ipc_callid_t callid;
    111111        size_t size;
     
    115115                return;
    116116        }
    117        
     117
    118118        if (size != sizeof(inet_addr_t)) {
    119119                async_answer_0(callid, EINVAL);
     
    121121                return;
    122122        }
    123        
     123
    124124        rc = async_data_read_finalize(callid, &hinfo->addr, size);
    125125        if (rc != EOK) {
     
    128128                return;
    129129        }
    130        
     130
    131131        if (!async_data_read_receive(&callid, &size)) {
    132132                async_answer_0(callid, EREFUSED);
     
    134134                return;
    135135        }
    136        
     136
    137137        size_t act_size = str_size(hinfo->cname);
    138138        if (act_size > size) {
     
    141141                return;
    142142        }
    143        
     143
    144144        rc = async_data_read_finalize(callid, hinfo->cname, act_size);
    145145        if (rc != EOK)
    146146                async_answer_0(callid, rc);
    147        
     147
    148148        async_answer_0(iid, rc);
    149        
     149
    150150        dns_hostinfo_destroy(hinfo);
    151151}
     
    155155{
    156156        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srvaddr_srv()");
    157        
     157
    158158        ipc_callid_t callid;
    159159        size_t size;
     
    163163                return;
    164164        }
    165        
     165
    166166        if (size != sizeof(inet_addr_t)) {
    167167                async_answer_0(callid, EINVAL);
     
    169169                return;
    170170        }
    171        
     171
    172172        // FIXME locking
    173        
     173
    174174        errno_t rc = async_data_read_finalize(callid, &dns_server_addr, size);
    175175        if (rc != EOK)
    176176                async_answer_0(callid, rc);
    177        
     177
    178178        async_answer_0(iid, rc);
    179179}
     
    183183{
    184184        log_msg(LOG_DEFAULT, LVL_DEBUG, "dnsr_set_srvaddr_srv()");
    185        
     185
    186186        ipc_callid_t callid;
    187187        size_t size;
     
    191191                return;
    192192        }
    193        
     193
    194194        if (size != sizeof(inet_addr_t)) {
    195195                async_answer_0(callid, EINVAL);
     
    197197                return;
    198198        }
    199        
     199
    200200        // FIXME locking
    201        
     201
    202202        errno_t rc = async_data_write_finalize(callid, &dns_server_addr, size);
    203203        if (rc != EOK) {
     
    205205                async_answer_0(iid, rc);
    206206        }
    207        
     207
    208208        async_answer_0(iid, rc);
    209209}
Note: See TracChangeset for help on using the changeset viewer.