Changeset 46577995 in mainline for uspace/srv/ns


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

Location:
uspace/srv/ns
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ns/clonable.c

    rfacacc71 r46577995  
    5555static list_t cs_req;
    5656
    57 int clonable_init(void)
     57errno_t clonable_init(void)
    5858{
    5959        list_initialize(&cs_req);
     
    128128       
    129129        /* Spawn a loader. */
    130         int rc = loader_spawn("loader");
     130        errno_t rc = loader_spawn("loader");
    131131       
    132132        if (rc != EOK) {
  • uspace/srv/ns/clonable.h

    rfacacc71 r46577995  
    3939#include <stdbool.h>
    4040
    41 extern int clonable_init(void);
     41extern errno_t clonable_init(void);
    4242
    4343extern bool service_clonable(service_t);
  • uspace/srv/ns/ns.c

    rfacacc71 r46577995  
    8181               
    8282                task_id_t id;
    83                 int retval;
     83                errno_t retval;
    8484               
    8585                service_t service;
     
    132132        printf("%s: HelenOS IPC Naming Service\n", NAME);
    133133       
    134         int rc = service_init();
     134        errno_t rc = service_init();
    135135        if (rc != EOK)
    136136                return EXIT_RC(rc);
  • uspace/srv/ns/service.c

    rfacacc71 r46577995  
    9595static list_t pending_conn;
    9696
    97 int service_init(void)
     97errno_t service_init(void)
    9898{
    9999        if (!hash_table_create(&service_hash_table, 0, 0,
     
    139139 *
    140140 */
    141 int register_service(service_t service, sysarg_t phone, ipc_call_t *call)
     141errno_t register_service(service_t service, sysarg_t phone, ipc_call_t *call)
    142142{
    143143        if (hash_table_find(&service_hash_table, &service))
     
    173173        sysarg_t arg3 = IPC_GET_ARG3(*call);
    174174        sysarg_t flags = IPC_GET_ARG4(*call);
    175         int retval;
     175        errno_t retval;
    176176       
    177177        ht_link_t *link = hash_table_find(&service_hash_table, &service);
  • uspace/srv/ns/service.h

    rfacacc71 r46577995  
    3838#include <abi/ipc/interfaces.h>
    3939
    40 extern int service_init(void);
     40extern errno_t service_init(void);
    4141extern void process_pending_conn(void);
    4242
    43 extern int register_service(service_t, sysarg_t, ipc_call_t *);
     43extern errno_t register_service(service_t, sysarg_t, ipc_call_t *);
    4444extern void connect_to_service(service_t, iface_t, ipc_call_t *, ipc_callid_t);
    4545
  • uspace/srv/ns/task.c

    rfacacc71 r46577995  
    151151static list_t pending_wait;
    152152
    153 int task_init(void)
     153errno_t task_init(void)
    154154{
    155155        if (!hash_table_create(&task_hash_table, 0, 0, &task_hash_table_ops)) {
     
    225225}
    226226
    227 int ns_task_id_intro(ipc_call_t *call)
     227errno_t ns_task_id_intro(ipc_call_t *call)
    228228{
    229229        task_id_t id = MERGE_LOUP32(IPC_GET_ARG1(*call), IPC_GET_ARG2(*call));
     
    264264}
    265265
    266 static int get_id_by_phone(sysarg_t phone_hash, task_id_t *id)
     266static errno_t get_id_by_phone(sysarg_t phone_hash, task_id_t *id)
    267267{
    268268        ht_link_t *link = hash_table_find(&phone_to_id, &phone_hash);
     
    276276}
    277277
    278 int ns_task_retval(ipc_call_t *call)
     278errno_t ns_task_retval(ipc_call_t *call)
    279279{
    280280        task_id_t id = call->in_task_id;
     
    296296}
    297297
    298 int ns_task_disconnect(ipc_call_t *call)
     298errno_t ns_task_disconnect(ipc_call_t *call)
    299299{
    300300        task_id_t id;
    301         int rc = get_id_by_phone(call->in_phone_hash, &id);
     301        errno_t rc = get_id_by_phone(call->in_phone_hash, &id);
    302302        if (rc != EOK)
    303303                return rc;
  • uspace/srv/ns/task.h

    rfacacc71 r46577995  
    3737#include <abi/proc/task.h>
    3838
    39 extern int task_init(void);
     39extern errno_t task_init(void);
    4040extern void process_pending_wait(void);
    4141
    4242extern void wait_for_task(task_id_t, ipc_call_t *, ipc_callid_t);
    4343
    44 extern int ns_task_id_intro(ipc_call_t *);
    45 extern int ns_task_disconnect(ipc_call_t *);
    46 extern int ns_task_retval(ipc_call_t *);
     44extern errno_t ns_task_id_intro(ipc_call_t *);
     45extern errno_t ns_task_disconnect(ipc_call_t *);
     46extern errno_t ns_task_retval(ipc_call_t *);
    4747
    4848
Note: See TracChangeset for help on using the changeset viewer.