mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-08 14:45:12 +00:00
apps/testing: Fix Coverity.
This commit is to make Coverity happy. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
parent
a16c545134
commit
e0e9f3d7e5
1 changed files with 25 additions and 4 deletions
|
|
@ -137,12 +137,15 @@ static FAR void *timerjitter(FAR void *arg)
|
|||
struct timespec next;
|
||||
struct timespec intv;
|
||||
struct itimerspec tspec;
|
||||
struct sigevent sigev;
|
||||
sigset_t sigset;
|
||||
timer_t timer;
|
||||
int64_t diff;
|
||||
int sigs;
|
||||
int ret;
|
||||
struct sigevent sigev =
|
||||
{
|
||||
0
|
||||
};
|
||||
|
||||
sigemptyset(&sigset);
|
||||
sigaddset(&sigset, SIGALRM);
|
||||
|
|
@ -154,8 +157,20 @@ static FAR void *timerjitter(FAR void *arg)
|
|||
sigev.sigev_notify = SIGEV_SIGNAL;
|
||||
sigev.sigev_signo = SIGALRM;
|
||||
|
||||
timer_create(param->clockid, &sigev, &timer);
|
||||
clock_gettime(param->clockid, &now);
|
||||
ret = timer_create(param->clockid, &sigev, &timer);
|
||||
|
||||
if (ret != 0)
|
||||
{
|
||||
printf("timer_create failed %d\n", ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = clock_gettime(param->clockid, &now);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
printf("clock_gettime failed %d\n", ret);
|
||||
}
|
||||
|
||||
next = now;
|
||||
calc_next(&next, &intv);
|
||||
|
|
@ -167,7 +182,13 @@ static FAR void *timerjitter(FAR void *arg)
|
|||
/* Using TIMER_ABSTIME */
|
||||
|
||||
tspec.it_value = next;
|
||||
timer_settime(timer, TIMER_ABSTIME, &tspec, NULL);
|
||||
ret = timer_settime(timer, TIMER_ABSTIME, &tspec, NULL);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
printf("timer_settime failed %d\n", ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
param->avg = 0;
|
||||
param->max = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue