Changeset 46577995 in mainline for uspace/srv/locsrv/locsrv.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 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/srv/locsrv/locsrv.c

    rfacacc71 r46577995  
    356356         * Get server name
    357357         */
    358         int rc = async_data_write_accept((void **) &server->name, true, 0,
     358        errno_t rc = async_data_write_accept((void **) &server->name, true, 0,
    359359            LOC_NAME_MAXLEN, 0, NULL);
    360360        if (rc != EOK) {
     
    410410 *
    411411 */
    412 static int loc_server_unregister(loc_server_t *server)
     412static errno_t loc_server_unregister(loc_server_t *server)
    413413{
    414414        if (server == NULL)
     
    471471        /* Get fqsn */
    472472        char *fqsn;
    473         int rc = async_data_write_accept((void **) &fqsn, true, 0,
     473        errno_t rc = async_data_write_accept((void **) &fqsn, true, 0,
    474474            LOC_NAME_MAXLEN, 0, NULL);
    475475        if (rc != EOK) {
     
    599599        }
    600600       
    601         int retval = async_data_read_finalize(callid, cat->name,
     601        errno_t retval = async_data_read_finalize(callid, cat->name,
    602602            min(size, act_size));
    603603       
     
    647647        }
    648648       
    649         int retval = async_data_read_finalize(callid, fqn,
     649        errno_t retval = async_data_read_finalize(callid, fqn,
    650650            min(size, act_size));
    651651        free(fqn);
     
    694694        }
    695695       
    696         int retval = async_data_read_finalize(callid, svc->server->name,
     696        errno_t retval = async_data_read_finalize(callid, svc->server->name,
    697697            min(size, act_size));
    698698       
     
    743743       
    744744        /* Get fqsn */
    745         int rc = async_data_write_accept((void **) &fqsn, true, 0,
     745        errno_t rc = async_data_write_accept((void **) &fqsn, true, 0,
    746746            LOC_NAME_MAXLEN, 0, NULL);
    747747        if (rc != EOK) {
     
    806806       
    807807        /* Get service name */
    808         int rc = async_data_write_accept((void **) &name, true, 0,
     808        errno_t rc = async_data_write_accept((void **) &name, true, 0,
    809809            LOC_NAME_MAXLEN, 0, NULL);
    810810        if (rc != EOK) {
     
    851851 * events.
    852852 *
    853  * On success, answer will contain EOK int retval.
     853 * On success, answer will contain EOK errno_t retval.
    854854 * On failure, error code will be sent in retval.
    855855 *
     
    895895/** Find ID for category specified by name.
    896896 *
    897  * On success, answer will contain EOK int retval and service ID in arg1.
     897 * On success, answer will contain EOK errno_t retval and service ID in arg1.
    898898 * On failure, error code will be sent in retval.
    899899 *
     
    905905       
    906906        /* Get service name */
    907         int rc = async_data_write_accept((void **) &name, true, 0,
     907        errno_t rc = async_data_write_accept((void **) &name, true, 0,
    908908            LOC_NAME_MAXLEN, 0, NULL);
    909909        if (rc != EOK) {
     
    972972        size_t size;
    973973        size_t act_size;
    974         int rc;
     974        errno_t rc;
    975975       
    976976        if (!async_data_read_receive(&callid, &size)) {
     
    10001000        fibril_mutex_unlock(&cdir.mutex);
    10011001       
    1002         int retval = async_data_read_finalize(callid, id_buf, size);
     1002        errno_t retval = async_data_read_finalize(callid, id_buf, size);
    10031003        free(id_buf);
    10041004       
     
    10471047        }
    10481048       
    1049         int retval = async_data_read_finalize(callid, desc, size);
     1049        errno_t retval = async_data_read_finalize(callid, desc, size);
    10501050       
    10511051        free(desc);
     
    11101110        }
    11111111       
    1112         int retval = async_data_read_finalize(callid, desc, size);
     1112        errno_t retval = async_data_read_finalize(callid, desc, size);
    11131113       
    11141114        free(desc);
     
    11231123        size_t size;
    11241124        size_t act_size;
    1125         int rc;
     1125        errno_t rc;
    11261126       
    11271127        if (!async_data_read_receive(&callid, &size)) {
     
    11631163        fibril_mutex_unlock(&cdir.mutex);
    11641164       
    1165         int retval = async_data_read_finalize(callid, id_buf, size);
     1165        errno_t retval = async_data_read_finalize(callid, id_buf, size);
    11661166        free(id_buf);
    11671167       
     
    12781278        catid_t cat_id;
    12791279        service_id_t svc_id;
    1280         int retval;
     1280        errno_t retval;
    12811281       
    12821282        svc_id = IPC_GET_ARG1(*icall);
     
    15281528       
    15291529        port_id_t port;
    1530         int rc = async_create_port(INTERFACE_LOC_SUPPLIER,
     1530        errno_t rc = async_create_port(INTERFACE_LOC_SUPPLIER,
    15311531            loc_connection_supplier, NULL, &port);
    15321532        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.