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:
Andy Gross 2018-05-11 14:42:43 -05:00 committed by Anas Nashif
parent d76cc488a2
commit 5575487da6
2 changed files with 2 additions and 4 deletions

View file

@ -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) {

View file

@ -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);