tests: posix: Fix sigevent initialization
This patch fixes a couple of coverity issues pertaining to uninitialized members of a sigevent structure. Coverity-ID: 183070 Coverity-ID: 185276 Signed-off-by: Andy Gross <andy.gross@linaro.org>
This commit is contained in:
parent
d76cc488a2
commit
5575487da6
|
@ -106,14 +106,13 @@ void handler(union sigval val)
|
|||
void check_timer_support(int clock_id)
|
||||
{
|
||||
int ret;
|
||||
struct sigevent sig;
|
||||
struct sigevent sig = {0};
|
||||
timer_t timerid;
|
||||
struct itimerspec value, ovalue;
|
||||
|
||||
sig.sigev_notify = SIGEV_SIGNAL;
|
||||
sig.sigev_notify_function = handler;
|
||||
sig.sigev_value.sival_int = 20;
|
||||
sig.sigev_notify_attributes = NULL;
|
||||
|
||||
ret = timer_create(clock_id, &sig, &timerid);
|
||||
if (ret != 0) {
|
||||
|
|
|
@ -25,7 +25,7 @@ void handler(union sigval val)
|
|||
void test_timer(void)
|
||||
{
|
||||
int ret;
|
||||
struct sigevent sig;
|
||||
struct sigevent sig = {0};
|
||||
timer_t timerid;
|
||||
struct itimerspec value, ovalue;
|
||||
struct timespec ts, te;
|
||||
|
@ -34,7 +34,6 @@ void test_timer(void)
|
|||
sig.sigev_notify = SIGEV_SIGNAL;
|
||||
sig.sigev_notify_function = handler;
|
||||
sig.sigev_value.sival_int = 20;
|
||||
sig.sigev_notify_attributes = NULL;
|
||||
|
||||
printk("POSIX timer test\n");
|
||||
ret = timer_create(CLOCK_MONOTONIC, &sig, &timerid);
|
||||
|
|
Loading…
Reference in a new issue