Changeset b7fd2a0 in mainline for uspace/srv/volsrv/volsrv.c


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

    r36f0738 rb7fd2a0  
    5454static void vol_client_conn(ipc_callid_t, ipc_call_t *, void *);
    5555
    56 static int vol_init(void)
    57 {
    58         int rc;
     56static errno_t vol_init(void)
     57{
     58        errno_t rc;
    5959        log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_init()");
    6060
     
    9090        size_t size;
    9191        size_t act_size;
    92         int rc;
     92        errno_t rc;
    9393
    9494        if (!async_data_read_receive(&callid, &size)) {
     
    112112        }
    113113
    114         int retval = async_data_read_finalize(callid, id_buf, size);
     114        errno_t retval = async_data_read_finalize(callid, id_buf, size);
    115115        free(id_buf);
    116116
     
    121121{
    122122        service_id_t sid;
    123         int rc;
     123        errno_t rc;
    124124
    125125        sid = IPC_GET_ARG1(*icall);
     
    139139        vol_part_t *part;
    140140        vol_part_info_t pinfo;
    141         int rc;
     141        errno_t rc;
    142142
    143143        sid = IPC_GET_ARG1(*icall);
     
    185185        service_id_t sid;
    186186        vol_part_t *part;
    187         int rc;
     187        errno_t rc;
    188188
    189189        sid = IPC_GET_ARG1(*icall);
     
    209209        vol_fstype_t fstype;
    210210        vol_label_supp_t vlsupp;
    211         int rc;
     211        errno_t rc;
    212212
    213213        fstype = IPC_GET_ARG1(*icall);
     
    249249        vol_fstype_t fstype;
    250250        char *label;
    251         int rc;
     251        errno_t rc;
    252252
    253253        sid = IPC_GET_ARG1(*icall);
     
    327327int main(int argc, char *argv[])
    328328{
    329         int rc;
     329        errno_t rc;
    330330
    331331        printf("%s: Volume service\n", NAME);
Note: See TracChangeset for help on using the changeset viewer.