Changeset a35b458 in mainline for uspace/srv/net/inetsrv/inetsrv.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/inetsrv/inetsrv.c

    r3061bc1 ra35b458  
    8787{
    8888        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_init()");
    89        
     89
    9090        port_id_t port;
    9191        errno_t rc = async_create_port(INTERFACE_INET,
     
    9393        if (rc != EOK)
    9494                return rc;
    95        
     95
    9696        rc = async_create_port(INTERFACE_INETCFG,
    9797            inet_cfg_conn, NULL, &port);
    9898        if (rc != EOK)
    9999                return rc;
    100        
     100
    101101        rc = async_create_port(INTERFACE_INETPING,
    102102            inetping_conn, NULL, &port);
    103103        if (rc != EOK)
    104104                return rc;
    105        
     105
    106106        rc = loc_server_register(NAME);
    107107        if (rc != EOK) {
     
    109109                return EEXIST;
    110110        }
    111        
     111
    112112        service_id_t sid;
    113113        rc = loc_service_register(SERVICE_NAME_INET, &sid);
     
    116116                return EEXIST;
    117117        }
    118        
     118
    119119        return EOK;
    120120}
     
    234234{
    235235        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srcaddr_srv()");
    236        
     236
    237237        uint8_t tos = IPC_GET_ARG1(*icall);
    238        
     238
    239239        ipc_callid_t callid;
    240240        size_t size;
     
    244244                return;
    245245        }
    246        
     246
    247247        if (size != sizeof(inet_addr_t)) {
    248248                async_answer_0(callid, EINVAL);
     
    250250                return;
    251251        }
    252        
     252
    253253        inet_addr_t remote;
    254254        errno_t rc = async_data_write_finalize(callid, &remote, size);
     
    257257                async_answer_0(iid, rc);
    258258        }
    259        
     259
    260260        inet_addr_t local;
    261261        rc = inet_get_srcaddr(&remote, tos, &local);
     
    264264                return;
    265265        }
    266        
     266
    267267        if (!async_data_read_receive(&callid, &size)) {
    268268                async_answer_0(callid, EREFUSED);
     
    270270                return;
    271271        }
    272        
     272
    273273        if (size != sizeof(inet_addr_t)) {
    274274                async_answer_0(callid, EINVAL);
     
    276276                return;
    277277        }
    278        
     278
    279279        rc = async_data_read_finalize(callid, &local, size);
    280280        if (rc != EOK) {
     
    283283                return;
    284284        }
    285        
     285
    286286        async_answer_0(iid, rc);
    287287}
     
    291291{
    292292        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_send_srv()");
    293        
     293
    294294        inet_dgram_t dgram;
    295        
     295
    296296        dgram.iplink = IPC_GET_ARG1(*icall);
    297297        dgram.tos = IPC_GET_ARG2(*icall);
    298        
     298
    299299        uint8_t ttl = IPC_GET_ARG3(*icall);
    300300        int df = IPC_GET_ARG4(*icall);
    301        
     301
    302302        ipc_callid_t callid;
    303303        size_t size;
     
    307307                return;
    308308        }
    309        
     309
    310310        if (size != sizeof(inet_addr_t)) {
    311311                async_answer_0(callid, EINVAL);
     
    313313                return;
    314314        }
    315        
     315
    316316        errno_t rc = async_data_write_finalize(callid, &dgram.src, size);
    317317        if (rc != EOK) {
     
    319319                async_answer_0(iid, rc);
    320320        }
    321        
     321
    322322        if (!async_data_write_receive(&callid, &size)) {
    323323                async_answer_0(callid, EREFUSED);
     
    325325                return;
    326326        }
    327        
     327
    328328        if (size != sizeof(inet_addr_t)) {
    329329                async_answer_0(callid, EINVAL);
     
    331331                return;
    332332        }
    333        
     333
    334334        rc = async_data_write_finalize(callid, &dgram.dest, size);
    335335        if (rc != EOK) {
     
    337337                async_answer_0(iid, rc);
    338338        }
    339        
     339
    340340        rc = async_data_write_accept(&dgram.data, false, 0, 0, 0,
    341341            &dgram.size);
     
    344344                return;
    345345        }
    346        
     346
    347347        rc = inet_send(client, &dgram, client->protocol, ttl, df);
    348        
     348
    349349        free(dgram.data);
    350350        async_answer_0(iid, rc);
Note: See TracChangeset for help on using the changeset viewer.