Changeset b7fd2a0 in mainline for kernel/test


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.

Location:
kernel/test/synch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/synch/rcu1.c

    r36f0738 rb7fd2a0  
    5555
    5656/*-------------------------------------------------------------------*/
    57 static void wait_for_cb_exit(size_t secs, exited_t *p, int *presult)
     57static void wait_for_cb_exit(size_t secs, exited_t *p, errno_t *presult)
    5858{
    5959        size_t loops = 0;
     
    113113                        bool joined = false;
    114114                        do {
    115                                 int ret = thread_join_timeout(thread[i], 5 * 1000 * 1000, 0);
     115                                errno_t ret = thread_join_timeout(thread[i], 5 * 1000 * 1000, 0);
    116116                                joined = (ret != ETIMEOUT);
    117117                               
     
    365365
    366366
    367 static int seq_test_result = EOK;
     367static errno_t seq_test_result = EOK;
    368368
    369369static atomic_t cur_time = {1};
     
    534534        join_one();
    535535       
    536         int result = EOK;
     536        errno_t result = EOK;
    537537        wait_for_cb_exit(2 /* secs */, p, &result);
    538538       
     
    553553typedef struct preempt_struct {
    554554        exited_t e;
    555         int result;
     555        errno_t result;
    556556} preempt_t;
    557557
  • kernel/test/synch/semaphore2.c

    r36f0738 rb7fd2a0  
    6060static void consumer(void *arg)
    6161{
    62         int rc;
     62        errno_t rc;
    6363        int to;
    6464       
Note: See TracChangeset for help on using the changeset viewer.